Travelling Around Morocco by Train: Routes, Tickets and Where the Rails End

Travelling Around Morocco by Train: Routes, Tickets and Where the Rails End

Morocco has one of the best rail networks in Africa, and for many trips the train is the calmest way to move between cities. It is cheap by European standards, mostly punctual, and it spares you the long drives and the haggling that come with grand taxis. It also has clear limits: several of the places visitors most want to see have no station at all. This guide explains what the network covers, how the high-speed line works, how to buy tickets, and when a bus or driver is the better choice.

What the rail network covers

Trains are run by the national operator, ONCF. The network is shaped roughly like a letter T lying on its side:

  • The Atlantic line runs from Tangier in the north down through Kenitra, Rabat and Casablanca to Marrakech.
  • The inland line branches east through Meknes and Fes, then continues towards Taza and Oujda near the Algerian border.
  • Shorter branches serve places such as El Jadida, Safi and Casablanca’s Mohammed V airport.

That means Tangier, Rabat, Casablanca, Marrakech, Meknes and Fes are all connected by rail. Chefchaouen, Tetouan, Essaouira, Ouarzazate, Aït Ben Haddou and the Sahara are not. For those you will need a coach, a shared taxi or a private driver for at least part of the way.

Al Boraq, the high-speed train

Al Boraq opened in 2018 and was the first high-speed line in Africa. It runs between Tangier and Casablanca via Kenitra and Rabat, cutting the Tangier to Casablanca trip to a little over two hours. South of Kenitra it uses upgraded conventional track, so it is not high-speed for the whole journey, but it is still much faster than the older services.

A few things to know:

  • Seats are assigned, and busy departures (Friday afternoons, Sunday evenings and holiday periods) do sell out. Book ahead if your dates are fixed.
  • There are two classes. Second class is comfortable; first class gives you more space and a quieter carriage.
  • Prices vary by how early you book and the time of day, so the same trip can cost noticeably more if you buy at the station on the day.
  • Work has been under way to extend high-speed rail south towards Marrakech. Until it opens, trips from Tangier to Marrakech mean Al Boraq to Casablanca or Rabat and a conventional train onwards. Check the ONCF timetable for the current situation before you travel.

Useful routes and rough journey times

Journey times change with timetables and engineering work, so treat these as planning figures, not promises:

Route Typical time Notes
Tangier – Casablanca about 2 h 10 min Al Boraq, direct
Tangier – Rabat about 1 h 20 min Al Boraq, direct
Casablanca – Marrakech about 2 h 40 min Conventional, frequent
Casablanca – Fes about 3 to 4 h Conventional, via Rabat and Meknes
Fes – Marrakech about 7 h Long; direct trains exist but a flight or a stopover in Rabat can be better
Tangier – Fes about 4 to 5 h Direct conventional, or Al Boraq to Kenitra and change
Casablanca airport – Casa Voyageurs about 35 min Airport shuttle train

There is also an overnight train between Tangier and Marrakech with sleeping compartments. It saves a hotel night but arrives early in the morning, so it suits travellers who sleep well on the move.

Buying tickets

You have three options:

  1. The ONCF app or website. The easiest route for most visitors. You choose the train, pay by card and get an e-ticket with a QR code. Some foreign cards are declined; if yours is, try another card or buy at the station.
  2. Station ticket offices and machines. Larger stations have both. Queues can be long before busy departures, so arrive at least 30 minutes early if you have not booked.
  3. Your riad or hotel. Many will book for you for a small fee, which is useful if you want a fixed plan without handling the app.

On conventional trains a second-class ticket does not always guarantee a seat on busy services. If comfort matters on a long leg such as Fes to Marrakech, first class is often worth the difference.

On the day

  • Keep your ticket and passport together. Inspectors check tickets on board, and Al Boraq has a quick gate check before the platform.
  • Larger stations such as Casa Voyageurs, Rabat Agdal, Marrakech and Fes have cafés and toilets. Smaller stations have little, so carry water and a snack.
  • Delays on conventional lines are usually short but can stack up on long routes. Do not book a tight connection to a flight.
  • Porters and taxi drivers wait at the exits of big stations. Agree the fare before you get in, or use a petit taxi with a running meter in cities where that is normal.
  • During Ramadan, timetables can shift and the hour before sunset is busy. Our guide to Ramadan in Morocco covers what changes.

Where the train stops: reaching the rest of Morocco

For places off the rail network, the usual options are:

  • Supratours coaches. Run by ONCF, they connect with trains and can be booked together. Useful for Essaouira from Marrakech and for some southern routes.
  • CTM coaches. The main national coach company, with a wide network including Chefchaouen, Tetouan, Ouarzazate and Merzouga.
  • Grand taxis. Shared long-distance taxis that leave when full. Cheap and quick for short hops, such as Tetouan to Chefchaouen, but cramped. You can pay for all six seats if you want the car to yourselves.
  • A private driver. Worth it for the Atlas, the Draa Valley and the desert, where the drive itself is part of the trip.

Sample itineraries using the train

Northern loop (6 to 8 days): fly into Tangier, spend two days there, take a coach or grand taxi to Tetouan and Chefchaouen, then continue by road to Fes and finish with the train to Rabat or Casablanca. See our free guides to Tangier, Chefchaouen and Fes.

Imperial cities (7 to 10 days): fly into Casablanca, take the airport train to the city, then train to Rabat, Meknes and Fes. From Fes, either take the long train to Marrakech or fly. Our Marrakech guide covers the last stop.

Marrakech and the coast (5 to 7 days): train from Casablanca to Marrakech, then a Supratours or CTM coach to Essaouira for a slower few days by the sea.

All the city guides are free and collected on the Morocco destinations page. To estimate what a route like this will cost, including transport, try the travel budget calculator.

Quick checklist

  • Check which of your destinations actually have a station
  • Book Al Boraq in advance for weekends and holidays
  • Download the ONCF app and test your card before you travel
  • Choose first class for long conventional legs
  • Leave a buffer before flights
  • Plan coaches or a driver for Chefchaouen, Essaouira and the south

Frequently asked questions

Is train travel in Morocco safe?

Yes. Trains are widely used by Moroccan families, students and business travellers. Take the usual care with bags in busy stations and keep valuables with you rather than on the luggage rack.

Can I travel from Marrakech to the Sahara by train?

No. The line ends at Marrakech. Most visitors reach Merzouga or Zagora by private driver, an organised tour or a CTM coach, usually breaking the journey on the way. Our Sahara guide explains the options.

Is first class worth it?

On Al Boraq, second class is already comfortable. On long conventional journeys, first class usually means a guaranteed seat and more room, which many travellers find worth the extra cost.

Do I need to print my ticket?

No. An e-ticket on your phone with its QR code is accepted, but keep a screenshot in case you lose signal.