Trains in Morocco: ONCF Routes, Classes, and Booking
Morocco's ONCF trains are comfortable, punctual, and the best way between the imperial cities — but they don't reach everywhere. Routes, first vs second class, and how to book.
Morocco's national railway, ONCF, runs comfortable and punctual trains that are the best way to travel between the major cities, and for a first-timer they turn the long hops of a classic loop into the easy part of the trip. The catch is that the network reaches only part of the country, so knowing where the train goes — and where it stops — shapes how you plan every leg. Here is what it covers and how to use it.
Where the trains actually go
The ONCF network links Casablanca, Rabat, Fez, Marrakech and Tangier with comfortable, reliable service, and the Al Boraq high-speed line connects Tangier and Casablanca in a fraction of the old time. This covers the spine of a classic first trip — Marrakech to Casablanca to Fez runs entirely by rail. What it does not cover is just as important to know before you build an itinerary around it.
Where the train does not reach
There is no train to Chefchaouen, to Essaouira, or to the Sahara gateways, and these gaps are filled by coach or grand taxi rather than rail. A Marrakech-Fez-Chefchaouen trip, for instance, is train as far as Fez and then a coach onward to the blue city. Planning as though the train reaches everywhere is the single most common itinerary mistake, and it is easily avoided by checking the map first.
First class or second
Moroccan trains offer first and second class, and the practical difference is a reserved seat: first class guarantees you a specific seat in a compartment, while second class is cheaper and can be crowded and unreserved on busy routes. On a long or peak-season leg, first class is a small premium that buys a comfortable, certain seat, and it is the sensible choice for most visitors carrying luggage. Second class is perfectly fine for shorter, off-peak hops.
How to book
Tickets can be bought at station counters, from machines, and online through ONCF, and for popular routes in high season booking a day or two ahead secures a first-class seat rather than leaving it to chance. For most of the year, buying at the station on the day is straightforward. Keep the ticket accessible for the on-board check, and note that the high-speed Al Boraq services are booked separately and fill faster.
At the station
Moroccan stations in the big cities are modern and easy to navigate, with clear departure boards, and petit taxis wait outside for the last leg to your riad. Arrive with a little time in hand for busy periods, keep an eye on the board for your platform, and you will find rail one of the least stressful parts of a Morocco trip. It is, genuinely, the country at its most straightforward.
Comfort, luggage and the family case
For families and anyone travelling with real luggage, the train is the most comfortable long-distance option in Morocco by a clear margin: room to move, space for bags, and no cramped shared sedan or long drive. First class in particular gives children a reserved seat and you a calm few hours. On the rail spine of a classic loop, it removes the most tiring part of the trip almost entirely.
Timing and connections
Trains run frequently on the main routes, so a missed connection rarely means a lost day, and the punctuality ONCF is known for makes planning tight days realistic. Build a little buffer at interchange stations, keep an eye on the board, and treat the rail legs as the fixed, dependable skeleton around which the coach and taxi legs flex. That reliability is what lets the rest of an itinerary breathe.
Train versus the alternatives
Where the train runs, it beats the alternatives comfortably: it is faster and calmer than a grand taxi, more comfortable than a coach, and removes the driving that first-timers are wise to avoid. Where it does not run, CTM and Supratours coaches are the reliable next step, and a private driver buys door-to-door convenience at a higher price. Matching each leg to the right mode is what makes a loop flow.
Choosing rail where it runs and coaches where it doesn't is one thread of a larger sequencing question — which leg by which mode, and how that decides where you can base. Which leg goes by which mode, and how that decides where you base, is one of the calls worked out in the complete Morocco trip guide. Our transport overview covers all the modes together, and the 10-day itinerary shows a full loop in practice.
Morocco trains: FAQ
Which cities are on the train network?
Casablanca, Rabat, Fez, Marrakech and Tangier, with the Al Boraq high-speed line between Tangier and Casablanca.
Can I take the train to Chefchaouen or Essaouira?
No. Neither is on the rail network, nor are the Sahara gateways — reach them by CTM or Supratours coach or by grand taxi.
Is first class worth it?
On long or peak-season legs, yes — it guarantees a reserved seat for a small premium. Second class is fine for shorter, off-peak hops.
How do I book?
Station counters, machines, or online via ONCF. Book a day or two ahead for popular routes in high season; the high-speed line fills faster.
Is the train better than the bus?
Where it runs, yes — faster and calmer. Where it doesn't, CTM and Supratours coaches are the reliable next step.