· Travel · 5 min read
Morocco by Train: Routes, Tickets and Where Rails End
Plan Morocco by train: the cities the rails reach, ONCF fares and classes, and where you switch to a driver for the desert.
Morocco’s rail network is smaller than the national map suggests, and better than most visitors expect. Trains leave roughly hourly on the main corridor, a second-class seat costs around 110 dirhams from Casablanca to Marrakech, and the high-speed line covers Tangier to Casablanca in about two hours ten. Planning Morocco by train works once you accept one limit: the rails follow the Atlantic cities and the imperial branches, then stop short of the mountains and the dunes.
The short answer is yes, on the Atlantic corridor and the imperial branches, where trains are frequent, cheap and punctual enough to build a trip around. No for Chefchaouen, Essaouira or the Sahara, which need a road leg from the last station. This guide covers the corridors that matter, the tickets and classes behind them, and the point where you swap rail for a driver.
Morocco by Train: What the Network Really Covers
ONCF, the national operator, runs two products on one network. Al Boraq is the high-speed line, built for 320 km/h, connecting Tangier, Kenitra, Rabat Agdal and Casa Voyageurs. Al Atlas is the conventional intercity service that covers everything else, including Marrakech, Meknes and Fes.
The Morocco train routes that matter for a first trip are short and well served, and most of them pass through Casablanca.
- Tangier to Casablanca: about 2h10 on Al Boraq, roughly hourly.
- Tangier to Rabat: about 1h20 on the same line.
- Casablanca to Marrakech: 2h40 to 3h20 on conventional trains.
- Marrakech to Fes: 6h30 to 7h10, the long haul of the network.
No station serves Chefchaouen, Essaouira, the Atlas valleys or the dunes, and that gap shapes every practical itinerary. Al Boraq runs at 320 km/h on its own track, while the Marrakech and Fes branches use conventional stock, so plan around the timetable rather than the distance.
The Atlantic Spine: Tangier, Rabat, Casablanca
If you build one rail stretch into your trip, make it this one. Tangier, Rabat and Casablanca sit on a single fast line, and each hop feels like a morning move rather than a travel day. Rabat to Casablanca takes under an hour.

Train travel in Morocco gets fiddly at the booking screen because several cities run more than one station. Picking the wrong one adds a taxi ride across town:
- Tanger Ville and Tanger Med: Ville is the city-centre stop; Med serves the port complex, far outside town.
- Rabat Agdal and Rabat Ville: Al Boraq stops at Agdal, while Rabat Ville handles classic-line trains only.
- Casa Voyageurs and Casa Port: Voyageurs is the intercity hub; Casa Port covers regional services.
- Marrakech and Fes: both stations sit outside the medina walls, so allow a short taxi at the end.
Tickets, Classes and Station Realities
ONCF train tickets are cheap enough that class becomes a comfort choice. Tangier to Casablanca costs roughly 99 to 224 dirhams in second class and 129 to 292 in first. Casablanca to Marrakech runs about 110 dirhams in second, and advance promo seats appear from around 89. Children under four travel free, and ages four to ten pay half.
Online sales open about three months ahead, and station counters sell same-day tickets. Foreign cards sometimes fail at checkout, so carry a backup payment method.
- First class: six-seat air-conditioned compartments, an assigned seat, and lounge access at Tanger Ville, Kenitra, Rabat Agdal and Casa Voyageurs.
- Second class: eight-seat compartments with basic padded seats, and plenty for a two-hour hop.
There is no validation machine anywhere. You buy, board, and the conductor checks your ticket once the train is moving. Seat reservation in second class varies by service, and some older trains work on a first-come basis. Racks are small and nobody helps with bags, so pack what you can lift.
Where the Rails Stop: Chefchaouen, Essaouira, the Sahara
Several of the destinations people fly in for have no station at all, and the last train leaves you a road leg away.

- Chefchaouen: no rail. Ride to Tangier or Fes, then continue by road.
- Essaouira and Agadir: Marrakech is the railhead, coaches leave from beside the station, and counters sell combined rail-plus-bus tickets.
- Ouarzazate, Ait Benhaddou and Imlil: Marrakech again, then over the Tizi n’Tichka pass by road.
- Merzouga and Erg Chebbi: Fes or Marrakech, then a long desert drive.
- Agafay: under an hour from Marrakech, the simplest desert-feel add-on.
For those road legs, our guide to coach and bus travel in Morocco covers operators and how to reserve a seat. If you are still working out how two cities link up, the route-by-route planning guide takes each pairing in turn.
Rail First, Driver After: Building the Route
The workable method has two layers: rail for every city on the network, and a driver for the rest. Start in Tangier or Casablanca, both rail-served and both easy to reach from an airport, then put the long conventional legs on a travel day of their own.
The overnight Tangier to Marrakech train carries four-berth couchettes, which trades a night’s comfort for a night’s hotel bill. Couchettes cannot be booked online, so arrange them at a counter once you land.
Our 8-Day Tour from Tangier through Chefchaouen, Fes, Merzouga and the imperial cities picks up where the northern line ends. The 8-Day Tour from Casablanca to Morocco’s imperial cities does the same from the Casa Voyageurs platform. Leave a buffer between a train arrival and a booked transfer, particularly on the conventional lines.
We can customize a tour to match your needs - design your perfect itinerary
If you found this helpful, add us as your preferred source on Google.
Frequently Asked Questions
Which Moroccan cities are connected by train?
Tangier, Kenitra, Rabat, Casablanca, Meknes, Fes and Marrakech form the core of the network. Al Boraq high-speed trains cover the Tangier to Casablanca line, while conventional Al Atlas trains run the branches to Marrakech, Meknes and Fes. Marrakech and Fes sit at the end of branch lines, so many journeys pass through Casablanca or Kenitra.
How much does a train ticket cost, and is first class worth it?
Tangier to Casablanca runs about 99 to 224 dirhams in second class and 129 to 292 in first, while Casablanca to Marrakech costs around 110 dirhams in second. First class buys a six-seat air-conditioned compartment and an assigned seat, which helps on the long legs. On a two-hour hop it adds very little to the journey.
Do you need to validate a train ticket before boarding?
No. There is no stamping machine and no platform validation in Morocco: you buy the ticket, board the train, and the conductor checks it on board. Buy before you walk through to the platform and keep the ticket within reach for the whole trip.
Can you reach Chefchaouen, Essaouira or the Sahara by train?
No. Chefchaouen has no station, so you ride to Tangier or Fes and continue by road. Essaouira and Agadir connect by coach from Marrakech, which is the railhead for the Atlantic south. Merzouga and the Erg Chebbi dunes need a long drive from Fes or Marrakech, and no train touches the desert section.
Ready for an Adventure?
Have questions? Feel free to contact us using the form below. We're here to help!