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

RouteApproximate timeChange
Marrakech – Casablanca2 h 40Direct
Marrakech – RabatAbout 4 hDirect
Marrakech – FesAbout 7 hDirect
Marrakech – Tangier5 h to 5 h 30In Casablanca, onto Al Boraq
Casablanca – Tangier on Al BoraqJust over 2 hDirect
Casablanca airport – Casa VoyageursAbout 35 minRail 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:

DestinationFrom Marrakech, without a trainOur article
EssaouiraBus in 3 h or private transfer in 2 h 45Marrakech to Essaouira
Agadir and TaghazoutBus in 3 h 30 or private transfer in 3 hMarrakech to Agadir or Taghazout
OuarzazateBus in 4 h 30 or private driver over the TichkaMarrakech to Ouarzazate
MerzougaBus in about 12 h or private transfer in 9 to 10 hMarrakech to Merzouga
Imlil and the AtlasGrand taxi or private transfer in 1 h 30Marrakech 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.