The train is often the first option travellers think of for getting around Morocco, and it is a good idea on some routes: ONCF trains are comfortable, cheap and fairly punctual, and the Al Boraq high-speed line links Tangier and Casablanca in just over two hours. But the network only covers part of the country. Essaouira, Agadir, Ouarzazate and Merzouga have no station. Here is how trains work in Morocco, real journey times from Marrakech, how to buy tickets and what to do where the train does not go.
Morocco’s rail network
The network of ONCF, the national rail company, essentially follows two lines:
- The Atlantic line, north to south: Tangier – Kenitra – Rabat – Casablanca – Marrakech. Marrakech is currently the southern end of the network.
- The east-west line: Casablanca and Rabat to Meknes, Fes, Taza and Oujda.
A few branch lines also serve El Jadida, Safi and Nador. The two main airports are not in the same situation: Casablanca’s is linked to the network by a rail shuttle, Marrakech’s is not.
Al Boraq, the high-speed train
Since 2018, Al Boraq has linked Tangier and Kenitra on a high-speed line, then continued to Rabat and Casablanca on the upgraded conventional line. Allow about 1 h 20 between Tangier and Rabat, and just over two hours between Tangier and Casablanca. The extension of high-speed rail to Marrakech is under construction, but it will not be running for several years.
On Al Boraq every seat is reserved, in first and second class alike, and prices vary with the date of purchase: the earlier you book, the cheaper it is.
Journey times from Marrakech
| Route | Approximate time | Change |
|---|---|---|
| Marrakech – Casablanca | 2 h 40 | Direct |
| Marrakech – Rabat | About 4 h | Direct |
| Marrakech – Fes | About 7 h | Direct |
| Marrakech – Tangier | 5 h to 5 h 30 | In Casablanca, onto Al Boraq |
| Casablanca – Tangier on Al Boraq | Just over 2 h | Direct |
| Casablanca airport – Casa Voyageurs | About 35 min | Rail shuttle |
Our guides Marrakech to Casablanca and Marrakech to Fes compare these trains with the bus and the car for each journey.
First or second class?
On conventional trains, first class guarantees a reserved seat, more space and quieter carriages. In second class seats are not assigned: you sit wherever you find room, which can be difficult on busy days, Friday afternoons, Sunday evenings and around holidays. For a journey of more than two hours, or with luggage, first class is almost always worth the small extra cost.
Buying tickets
- Online or on the ONCF app: the e-ticket, with a QR code, is shown straight from your phone.
- At station counters and machines, in cash or by card.
- In advance for Al Boraq and on holiday departure days; for a conventional train on a weekday, buying on the day is often enough.
Stations to know
- Marrakech: the station is in the Gueliz district, about ten minutes by taxi from the medina.
- Casablanca has two main stations: Casa Voyageurs, where most main-line trains and Al Boraq stop, and Casa Port, closer to the city centre and the port.
- Rabat Ville is right in the centre, a few minutes from the medina.
- Fes: the station is in the new town, about fifteen minutes by taxi from the medina.
From the station you always have to reach your accommodation: with suitcases, plan on a petit taxi, and a porter in the medinas.
Cities the train does not serve
This is the most important point when planning a trip in the south. There is no station in:
| Destination | From Marrakech, without a train | Our article |
|---|---|---|
| Essaouira | Bus in 3 h or private transfer in 2 h 45 | Marrakech to Essaouira |
| Agadir and Taghazout | Bus in 3 h 30 or private transfer in 3 h | Marrakech to Agadir or Taghazout |
| Ouarzazate | Bus in 4 h 30 or private driver over the Tichka | Marrakech to Ouarzazate |
| Merzouga | Bus in about 12 h or private transfer in 9 to 10 h | Marrakech to Merzouga |
| Imlil and the Atlas | Grand taxi or private transfer in 1 h 30 | Marrakech to Imlil |
For these destinations, Supratours coaches, ONCF’s road subsidiary, take over from some stations with combined train and bus tickets. Our guide to CTM and Supratours buses covers these connections.
When the train is the right choice, and when it is not
The train is ideal if you are travelling alone or as a couple, with little luggage, between Marrakech, Casablanca, Rabat, Fes and Tangier. It is comfortable, cheap, and you can read or sleep.
A private transfer makes more sense in several cases:
- for every destination in the south, which the train does not serve;
- to catch a flight, when a missed connection would cost you the plane;
- as a family or group, when the per-person price of a private vehicle comes close to the tickets, taxis included;
- with lots of luggage, from one city’s medina to another’s.
Our guide to private tourist transport in Morocco sets out all the options, and our table of driving distances and travel times helps you build a realistic itinerary.
Book a journey where the train does not go
Our private transfers come at a fixed price per vehicle, with pick-up at your hotel or near your riad: the Marrakech to Essaouira transfer, the Marrakech to Agadir transfer and the Marrakech to Merzouga transfer. And if you land in Casablanca with Marrakech as your final destination, the Casablanca airport to Marrakech transfer saves you the shuttle, the change of train and the taxi on arrival.








