Morocco's ONCF trains link Tangier, Rabat, Casablanca, Fes, Meknes and Marrakech, and the Al Boraq high-speed train runs Tangier to Casablanca in about 2h10. Trains do not reach the Sahara, the Atlas, Chefchaouen or Essaouira, so you need road transport there.
Morocco train travel is comfortable, cheap and reliable between the big cities. The national operator ONCF links Tangier, Rabat, Casablanca, Meknes, Fes and Marrakech, and Africa's first high-speed train, Al Boraq, covers Tangier to Casablanca in about 2 hours 10 minutes. The limit is geography: no train reaches the Sahara, the Atlas, Chefchaouen or Essaouira. This guide covers routes, journey times, approximate fares and tickets, and explains where you will need a road option instead.
How Morocco's rail network works
ONCF (Office National des Chemins de Fer) runs all passenger trains. Picture the network as a backbone along the Atlantic, from Tangier to Marrakech via Kenitra, Rabat and Casablanca, with a main branch east from the coast through Meknes and Fes to Oujda near the Algerian border. Smaller lines serve El Jadida, Safi, Nador and Mohammed V airport. Official timetables and news are on oncf.ma.
Al Boraq high-speed train
Al Boraq opened in November 2018 on a dedicated high-speed line between Tangier and Kenitra, then continues on an upgraded line to Rabat Agdal and Casa Voyageurs. Trains are modern, double-deck and air-conditioned, with first and second class, a snack bar and power sockets. An extension from Kenitra towards Marrakech is under construction and is expected to cut journey times further in the coming years. Check the current status before travel. Wikipedia's Al Boraq page has the technical background.
Al Atlas conventional trains
Everything else runs on conventional intercity trains, branded Al Atlas, plus the Al Bidaoui commuter shuttle between Casablanca and the airport. They are slower but comfortable, especially in first class, where seats are assigned. There is also an overnight train with couchettes between Marrakech and Tangier.
Main train routes, journey times and fares
| Route | Train | Approx. time | Approx. 2nd class fare |
|---|---|---|---|
| Tangier - Rabat | Al Boraq | 1h20 | 15-30 EUR |
| Tangier - Casablanca | Al Boraq | 2h10 | 20-40 EUR |
| Casablanca - Marrakech | Al Atlas | 2h40 | 10-15 EUR |
| Rabat - Marrakech | Al Atlas | About 4h | 13-18 EUR |
| Casablanca - Fes | Al Atlas | 3h30-4h | 11-16 EUR |
| Fes - Meknes | Al Atlas | About 40 min | 2-4 EUR |
| Marrakech - Fes | Al Atlas (direct or 1 change) | 6h30-7h30 | 20-28 EUR |
| Casablanca airport - Casa Voyageurs | Al Bidaoui shuttle | About 35-40 min | 4-5 EUR |
Fares are approximate and Al Boraq uses demand-based pricing, so book early for the best price. First class usually costs 40-60% more. Always check timetables and fares with ONCF before travel.
Buying tickets and practical tips
- Where to buy: the ONCF app and website accept international cards and issue e-tickets with a QR code. You can also buy at station counters or ticket machines.
- When to book: a few days ahead is enough most of the year. Book Al Boraq and Friday or Sunday trains earlier, and travel around Eid holidays well in advance, when trains fill completely.
- First or second class: on long Al Atlas journeys (Marrakech-Fes) we recommend first class for an assigned seat. In second class at peak times you may end up standing.
- Stations: in Casablanca, Casa Voyageurs is the main hub, while Casa Port is near the centre and the Hassan II Mosque. In Rabat, Rabat Ville is central and Rabat Agdal serves Al Boraq. Marrakech station is in Gueliz, about 10-15 minutes by taxi from the medina.
- Delays: Al Boraq is very punctual. Conventional trains can run 15-30 minutes late, so do not plan tight connections to flights.
- Luggage: there is no strict limit, but space for large suitcases is limited. Keep valuables with you.
Where trains don't go: the desert, mountains and coast
This is where many first-time itineraries go wrong. The railway ends in Marrakech in the south and in Fes and Oujda in the east. Some of Morocco's most famous places can only be reached by road:
- The Sahara: Merzouga (Erg Chebbi) is about 560 km from Marrakech and 470 km from Fes, and Zagora is about 360 km from Marrakech.
- The High Atlas and the kasbah route: Tizi n'Tichka, Ait Ben Haddou, Ouarzazate, and the Dades and Todra gorges.
- The north and the coast: Chefchaouen, Tetouan, Essaouira and Agadir. ONCF's coach brand, Supratours, connects some of these places from railway stations.
For the desert legs, a private driver or tour is far more practical than a bus. Our Marrakech to Merzouga guide compares the options. In our experience the best combination is often train between the big cities, then a private driver in Morocco for the Sahara and the Atlas, where the stops on the way are half the experience.

Train or private driver: which suits your trip?
Both have their place. The train is ideal for solo travelers and for city-to-city legs on the Atlantic axis. A driver makes more sense for families, small groups, anyone with heavy luggage, and every route that leaves the rail network. For a detailed comparison see public transport vs private tours in Morocco.
A typical combined itinerary
- Arrive in Casablanca and take the Al Bidaoui shuttle or a transfer into the city (see our Casablanca airport to Marrakech transfer guide).
- Take the train from Casablanca to Fes (about 3h30) and spend two nights in the medina.
- Meet a private driver in Fes for the route to Merzouga, the desert camp, the gorges and Ait Ben Haddou.
- End in Marrakech, with no need to return to a station.
If you land in Casablanca and prefer door-to-door comfort throughout, our Morocco tours from Casablanca cover the imperial cities and the desert with the same driver from day one.
Get a tailor-made plan, by rail and road
Not sure which legs to do by train and which by car? Send us your dates and must-see places. We will suggest the most efficient mix, with private transfers only where they add real value. Ask for your free private-tour quote and you will receive a reply within 24 hours.
Frequently asked questions
Is there a train from Marrakech to the Sahara desert?
No. Morocco's railway ends in Marrakech, and no line crosses the Atlas mountains to the Sahara. To reach Merzouga, about 560 km away, or Zagora, about 360 km away, you need to travel by road: a private driver or tour, a shared tour, a long-distance bus, or a rental car. Most travelers split the drive over two days with stops.
How long is the train from Casablanca to Marrakech?
The conventional Al Atlas train from Casa Voyageurs to Marrakech takes about 2 hours 40 minutes, with frequent departures throughout the day. A second-class ticket costs approximately 10 to 15 EUR and first class a little more. Check the latest timetable on the ONCF app, because schedules change, and allow a buffer for possible delays.
Does Al Boraq go to Marrakech?
Not directly yet. Al Boraq high-speed trains currently run between Tangier, Kenitra, Rabat and Casablanca. To continue to Marrakech you change at Casa Voyageurs to a conventional train, which makes Tangier to Marrakech roughly 5 to 6 hours. A high-speed extension towards Marrakech is under construction, so check the current status before travel.
Are trains in Morocco safe and comfortable?
Yes. Moroccan trains are generally safe, affordable and comfortable, and many travelers, including solo women, use them. Al Boraq is modern and punctual. Al Atlas trains are older but air-conditioned. Choose first class on long journeys for an assigned seat, keep an eye on your bags, and avoid travelling just before major holidays, when trains are crowded.
