Last updated: 24 November 2026 · Written by the Journey Via Morocco team.
Is train travel good in Morocco? Yes, for the main cities. The national railway, ONCF, links Tangier, Rabat, Casablanca, Fes, Meknes and Marrakech, and the Al Boraq high-speed line connects Tangier with Rabat and Casablanca in a little over two hours. Trains do not go to the Sahara, the Atlas valleys or Essaouira, so most travellers combine trains with a private driver or tour.
Main train routes
- Tangier – Rabat – Casablanca: Al Boraq high-speed, about 2 hours 10 minutes Tangier to Casablanca.
- Casablanca – Marrakech: about 2.5 to 3 hours.
- Casablanca – Rabat – Meknes – Fes: about 3 to 3.5 hours Casablanca to Fes.
- Marrakech – Fes: direct trains of around 6.5 to 7 hours.
- Night trains run on some long routes, such as Tangier to Marrakech.
Exact times change; check the ONCF timetable before you travel.
Tickets and classes
- Buy at stations, online or on the ONCF app.
- First class: assigned seats and more space.
- Second class: cheaper, can be crowded at weekends and holidays.
- Book Al Boraq in advance in high season.
Where trains don’t go
- The Sahara (Merzouga, Zagora)
- Ait Ben Haddou, Ouarzazate and the gorges
- Chefchaouen and Essaouira
For these, use a private driver or tour. Compare options in how to get around Morocco and see tours with a private driver.
Combining train and tour
A popular plan: take Al Boraq from Tangier to Rabat or Casablanca, the train to Fes, then a private desert tour from Fes to Merzouga and Marrakech. See Casablanca to Fes and Casablanca to Marrakech.
Tips
- Arrive 20 to 30 minutes early at big stations.
- Keep your ticket for inspection.
- Carry water and snacks on long routes.
Need a driver for the parts trains don’t reach? Browse tours from Fes or contact us.
Frequently asked questions about trains in Morocco
Is there a train from Marrakech to the Sahara?
No. The rail network does not reach Merzouga or Zagora. You need a private driver, a tour or a bus.
How long is the train from Casablanca to Marrakech?
Usually around 2.5 to 3 hours on the conventional line.
How do I buy train tickets in Morocco?
At station counters or machines, on the ONCF website or the ONCF app.
Is first class worth it on Moroccan trains?
On busy routes and in summer, first class is more comfortable and usually has assigned seats, for a modest extra cost.




