Train track with a palm tree, Morocco
By Rail

Morocco by train

ONCF, the Al Boraq high-speed line and the network.

By the Viamo editorial team · Editor Terje Moy · Last updated July 2026 · 5 min read

Morocco has one of the more developed and comfortable rail networks in Africa, run by the state operator ONCF, and it is genuinely one of the best ways to move between the country's main cities — fast, air-conditioned and considerably more relaxed than the country's roads. It also has clear limits: large parts of Morocco, including the south and the Sahara, are not served by rail at all. Here is how the network fits together.

ONCF: the national network

ONCF (Office National des Chemins de Fer) operates Morocco's rail network, which forms a rough backbone running from Tangier in the north down through Rabat and Casablanca, then splitting toward Marrakech in the southwest and Fès and Oujda to the east. Casablanca is the effective hub, with most cross-country journeys either starting there or passing through. Trains run in first and second class, both air-conditioned; first class is inexpensive by European standards and worth the modest upgrade on longer journeys.

Booking is straightforward through the ONCF website or app, or at any station ticket counter. Advance booking is not usually essential outside Moroccan public holidays and school breaks, but doing so removes any risk on popular routes and is simple to do online.

Al Boraq: Africa's first high-speed line

Morocco's Al Boraq is the first true high-speed rail line in Africa, running between Tangier and Kenitra (just north of Rabat) at speeds up to 320 km/h, cutting a journey that once took several hours down to about 50 minutes. Beyond Kenitra, Al Boraq trains continue on conventional track to Rabat and Casablanca, so the full Tangier–Casablanca journey — combining the high-speed section with the conventional continuation — takes a little over two hours in total, a dramatic improvement on the old line.

Where Al Boraq does and doesn't run: As of 2026, the true high-speed segment covers Tangier–Kenitra only. Extension plans southward — eventually linking Marrakech and beyond, partly driven by momentum from Morocco's 2030 FIFA World Cup co-hosting plans — have been discussed for years, but no confirmed date exists for further high-speed sections. The Marrakech–Casablanca corridor, for instance, remains served by ONCF's conventional intercity trains, which are still a comfortable roughly three-hour journey. See our Marrakech to Casablanca route guide for the current picture on that corridor specifically.

Conventional intercity trains

Away from the Al Boraq segment, ONCF's conventional intercity trains cover the rest of the network at respectable if unspectacular speeds. Marrakech–Casablanca takes around three hours; Casablanca–Fès around three and a half to four hours; Rabat–Casablanca is a quick and frequent commuter-style hop of under an hour. These trains are comfortable, reasonably punctual, and a considerably more relaxed way to travel than the intercity coach or self-driving alternative on the same routes, particularly around Casablanca's notoriously busy ring road.

Where the trains don't go

The ONCF network does not reach Morocco's Atlantic coastal towns south of Casablanca in any meaningful way — there is no train to Essaouira, for instance, where CTM and Supratours coaches cover the roughly three-hour journey from Marrakech instead. Nor does rail reach the south and the Sahara-facing regions: there is no train to Merzouga or the desert towns, where the standard approach is an organised multi-day tour or self-driving over the High Atlas — see our Marrakech to Merzouga guide for how that route works. Supratours, closely linked to ONCF, effectively extends the rail network by coach into these areas the trains don't reach, and Supratours tickets can sometimes be booked alongside a connecting train journey.

Sleeper and overnight options

Morocco's distances are modest enough that overnight sleeper trains are not a major feature of the network in the way they are in India or historically were in Egypt — most journeys are comfortably done in a single daytime train. Travellers wanting to cover more ground overnight typically rely on overnight coaches rather than a rail sleeper product.

Practical tips

Stations in major cities (Casablanca Voyageurs, Marrakech, Rabat Ville, Tangier Ville) are modern, clean and easy to navigate, generally close to city centres. Trains can get busy around Moroccan public holidays, Friday afternoons and the start and end of school holidays — buying tickets a day or two ahead at these times avoids any risk of a sold-out service. Announcements and signage are generally in Arabic and French, with English increasingly present on the newer Al Boraq stock and major stations.

Casablanca Voyageurs in particular is worth knowing well if your trip involves multiple legs, since so many journeys change here even when Casablanca itself isn't the destination — allow a reasonable connection window rather than booking a tight change, especially in the middle of the day when the station is at its busiest. Left-luggage facilities exist at the larger stations, useful if you want to explore Casablanca or Rabat for a few hours between connections rather than sitting in the station.

Fares are generally affordable by European standards, and first class is rarely expensive enough that budget travellers need to default to second class out of necessity — it is worth the modest difference on any journey over a couple of hours. Trains have onboard toilets and, on longer routes, a snack trolley or café car; it is also common and easy to bring your own food and drink aboard.

Frequently asked questions

Is the Al Boraq high-speed train worth taking?

Yes, if your route includes the Tangier–Kenitra segment — it covers that stretch in about 50 minutes at up to 320 km/h, a dramatic improvement on the old line. Beyond Kenitra, the train continues on conventional (non-high-speed) track to Rabat and Casablanca.

Can I take a train from Marrakech to the Sahara or Merzouga?

No. The rail network does not extend to the desert regions. The standard approach is a multi-day organised tour by road over the High Atlas, or self-driving, with Supratours coaches covering part of the route to towns like Rissani.

Is there a train to Essaouira?

No, ONCF does not serve Essaouira. Supratours and CTM coaches cover the roughly three-hour road journey from Marrakech instead.

Do I need to book Moroccan trains in advance?

Not usually — tickets are often available on the day, including at the station. Booking a day or two ahead is sensible around Moroccan public holidays and school holiday periods, when popular services can sell out.

Sources and further reading: