Traveling by Train in Morocco: The Complete Guide

Traveling by Train in Morocco illustrated by a modern ONCF train at a Moroccan railway station, with passengers waiting on the platform, railway tracks, overhead electric lines, and a departure board displaying destinations such as Marrakech and Casablanca.

If you want an easy, comfortable and affordable way to move between Moroccan cities, take the train. Morocco has one of the best railway networks in Africa, including Al Boraq, the first high-speed train on the continent. Trains are clean, air-conditioned and usually on time, and they let you relax, look at the landscapes and meet Moroccan families on the way. For many of our travelers, a train ride becomes one of their favorite memories of the trip.

We cover traveling by train in Morocco: where the trains go (and where they do not), the different types of trains, classes, prices, how to buy tickets, the night train, the airport train, station tips, and how to combine the train with buses and private transfers to reach the desert, the mountains and the coast.

DetailInfo
OperatorONCF, the national railway company
High-speed trainAl Boraq, Tangier to Casablanca, up to 320 km/h
Classic intercity trainsAl Atlas, to Marrakech, Fes, Meknes, Oujda and more
ClassesFirst class and second class
BookingONCF website, ONCF app or station ticket office
PaymentCard online, cash or card at stations
Night trainTangier to Marrakech, with couchettes
Airport trainCasablanca Mohammed V Airport to the city, about 30 minutes to Casa Voyageurs
No trains toChefchaouen, Essaouira, Agadir, Ouarzazate, Merzouga
ComfortAir-conditioned, generally clean and safe

The first railways in Morocco were built in the early 20th century, during the French and Spanish protectorates, mainly to carry goods like phosphate and to link the ports with inland cities. After independence, the national railway company ONCF was created in 1963 and slowly modernized the network, adding electrified lines, new stations and air-conditioned trains.

The biggest change came in November 2018, when Morocco opened Al Boraq, the first high-speed train in Africa. The trains were built by the French company Alstom, similar to the double-decker TGV trains used in France. Since then, new stations have opened in Tangier, Rabat, Kenitra and Casablanca, and a second high-speed line to Marrakech is under construction.

Morocco’s railway network has two main lines that cross at the cities of Kenitra and Sidi Kacem:

  • North to south: Tangier, Kenitra, Rabat, Casablanca and Marrakech.
  • West to east: Rabat and Casablanca to Meknes, Fes, Taourirt and Oujda, with a branch to Nador on the Mediterranean.
  • Coastal and local lines: Casablanca to El Jadida and Safi, and frequent shuttles between Kenitra, Rabat, Casablanca and Settat.
  • Airport line: Casablanca Mohammed V International Airport to Casablanca.

This covers most of the big cities that travelers visit at the start or the end of their trip. But some of Morocco’s most famous places are not on the rail network at all, including the Sahara Desert, Chefchaouen and Essaouira. We explain how to reach them later in this guide.

Al Boraq: Africa’s First High-Speed Train

Opened in November 2018, Al Boraq runs between Tangier and Casablanca, with stops in Kenitra and Rabat. On the new line between Tangier and Kenitra, it reaches 320 km/h. The trip from Tangier to Casablanca takes about two hours and ten minutes, compared with almost five hours before. The trains are double-decker, modern and very comfortable, with a snack bar, power sockets and big windows.

Al Atlas: Classic Intercity Trains

Al Atlas trains are the classic intercity trains that serve the rest of the network, including Marrakech, Fes, Meknes and Oujda. They are slower but comfortable, with air conditioning. Older trains have compartments with six or eight seats, while newer ones have open carriages.

Shuttles and Regional Trains

Frequent shuttle trains, often called navettes, connect Kenitra, Rabat, Casablanca and Settat, and other regional trains serve smaller towns. They are useful for short trips, like Rabat to Casablanca.

The Night Train

A night train runs between Tangier and Marrakech, with couchette compartments of four beds. It is a great way to cover a long distance while you sleep and save one night in a hotel.

These are typical travel times. They can change with the timetable, so always check the ONCF website before your trip.

RouteTrainApproximate time
Tangier to RabatAl BoraqAbout 1 hour 20 minutes
Tangier to CasablancaAl BoraqAbout 2 hours 10 minutes
Rabat to CasablancaAl Boraq or shuttleAbout 1 hour
Casablanca to MarrakechAl AtlasAbout 2 hours 40 minutes to 3 hours
Casablanca to FesAl AtlasAbout 3.5 to 4 hours
Rabat to FesAl AtlasAbout 2.5 hours
Fes to MeknesAl AtlasAbout 40 minutes
Fes to MarrakechAl AtlasAbout 7 hours
Tangier to FesAl Atlas or Al Boraq with a change in KenitraAbout 3.5 to 4 hours
Tangier to MarrakechAl Boraq + Al Atlas, or night trainAbout 5 to 6 hours by day, 10 hours by night
Casablanca Airport to Casa VoyageursAirport trainAbout 30 minutes

Trains are not only practical in Morocco; some journeys are lovely too. Choose a window seat and enjoy the view:

  • Tangier to Kenitra on Al Boraq: green hills, farmland and glimpses of the Atlantic, all at 320 km/h.
  • Rabat to Casablanca: the train crosses the Bouregreg River near Rabat, with views of the old Kasbah of the Udayas and the modern Mohammed VI Tower.
  • Fes to Meknes: olive groves, wheat fields and the hills of the Middle Atlas foothills, especially green in spring.
  • Casablanca to Marrakech: wide plains that slowly become drier and redder, with the Jbilet hills and, on clear days, the snowy High Atlas in winter as you approach Marrakech.
  • Taourirt to Oujda: wide steppe landscapes in eastern Morocco, rarely seen by tourists.
FeatureFirst classSecond class
SeatReserved, numbered seatReserved on Al Boraq; on some classic trains seats are not numbered
ComfortWider seats, more spaceComfortable but busier
CrowdsCalmerCan be crowded on weekends and holidays
PriceHigherCheaper
Best forLong trips, luggage, peak daysShort trips, budget travel

Our advice: For long journeys like Fes to Marrakech, or during busy periods like summer, holidays and Fridays, first class is worth the extra money. You get a guaranteed seat and a more peaceful trip. For short hops like Rabat to Casablanca, second class is perfectly fine.

Train travel in Morocco is affordable. Prices depend on the class, the type of train, how early you book and the time of travel, especially on Al Boraq, where prices change with demand. Here are approximate one-way prices to help you plan:

RouteSecond classFirst class
Tangier to Casablanca (Al Boraq)From about 150 DHFrom about 240 DH
Casablanca to MarrakechAbout 110 to 150 DHAbout 170 to 230 DH
Casablanca to FesAbout 120 to 150 DHAbout 180 to 230 DH
Fes to MarrakechAbout 200 to 230 DHAbout 300 to 350 DH
Casablanca Airport to the cityAbout 50 to 60 DHAbout 80 DH
Night train couchette, Tangier to MarrakechAbout 370 DH and more

Prices are indicative and can change. Pay attention to the currency: all prices are in Moroccan dirhams. Read our guide to the Moroccan dirham for exchange tips.

Online on the ONCF Website or App

The easiest way is to book on the official ONCF website (oncf-voyages.ma) or with the official ONCF app. You choose your stations, date, time and class, pay by card, and receive an e-ticket with a QR code on your phone. Save a screenshot in case you have no internet at the station. Some foreign cards can be refused online; if this happens, try another card or buy at the station.

At the Station

You can also buy tickets at station ticket offices or self-service machines in big stations. Payment by cash is always accepted, and cards are accepted in most big stations. Arrive early on busy days, as queues can be long, especially on Friday afternoons, Sunday evenings and before holidays.

When to Book

  • Al Boraq: book a few days in advance for the best prices and seats, especially on weekends.
  • Al Atlas: you can often buy on the day, but book ahead in summer and around holidays.
  • Night train couchettes: book as early as possible, as places are limited.
  • Eid holidays: book early, because many Moroccans travel to their families.

Casablanca to Marrakech

This is one of the most popular routes for travelers who land in Casablanca. Trains leave Casa Voyageurs regularly through the day and take about 2 hours 40 minutes to 3 hours. The landscape changes from green farmland to dry red plains as you go south. Marrakech station is in the modern Gueliz district; from there, a petit taxi to the medina takes about 10 minutes. Choose first class in summer and on weekends, when trains are full.

Fes to Marrakech

Direct Al Atlas trains connect Fes and Marrakech in about seven hours, passing through Meknes, Rabat and Casablanca. It is a long day, but comfortable in first class, and much easier than driving if you do not want to go through the desert. Bring lunch, water and a book. Many travelers prefer to break the trip with a night in Rabat or Casablanca. If you want to see the Sahara between Fes and Marrakech, a desert tour is a much better option than the train.

Tangier to Fes

You have two options: a direct classic train in about four hours, or Al Boraq from Tangier to Kenitra and then a classic train to Fes, which can be a little faster depending on the connection. Both are good. The direct train is simpler, with no change and no rush to catch a connection. From Fes station, a petit taxi to the old medina takes about 15 minutes.

A Day Trip From Casablanca to Rabat

Rabat is only about one hour from Casablanca by train, making it a perfect day trip. Take an early train to Rabat Ville, which is in the city center, visit the Kasbah of the Udayas, the Hassan Tower and the Mausoleum of Mohammed V, and come back in the evening. Rabat is calm, clean and easy to explore on foot or by tram. From Fes, you can also join our day trip from Fes to Rabat.

Trains keep running during Ramadan and public holidays, but there are a few things to know. During Ramadan, Morocco usually moves its clocks back one hour, and timetables may change, so always check the time on your ticket. Around sunset, the trains are quieter because people break their fast; you may even be offered a date or a piece of bread by friendly passengers.

The busiest days of the year are before and after Eid al-Fitr and Eid al-Adha, when millions of Moroccans travel to visit their families. Trains are often fully booked, stations are crowded and queues are long. If your trip falls during these days, book your tickets as early as possible and choose first class. Summer weekends, especially to the coast and the north, are also busy.

The night train is a classic experience. It usually leaves in the evening and arrives the next morning. The couchette car has compartments with four beds, sheets and a pillow, and the compartments are shared. If you are a couple or a group of four, you can sometimes book a whole compartment. There is also a cheaper option to travel seated, but it is much less comfortable for a whole night.

  • Book your couchette early and check the exact time on your ticket.
  • Bring water, snacks and a light layer for the air conditioning.
  • Keep your valuables close to you at night.
  • Use the time zone carefully: train times follow Moroccan time.

If you land at Casablanca Mohammed V Airport, the train is a cheap and easy way to reach the city. The station is under the terminal, and trains usually run about every hour. The trip to Casa Voyageurs takes about 30 minutes; some trains continue to Casa Port, closer to the city center and the old medina. From Casa Voyageurs, you can change to Al Boraq to Rabat and Tangier, or to trains to Marrakech and Fes. Read our guides to the Casablanca international airport and Casablanca airport transfers.

CityMain stationTip
CasablancaCasa VoyageursThe main hub for Al Boraq, Marrakech and Fes trains
CasablancaCasa PortClosest to the city center and the old medina
RabatRabat Agdal and Rabat VilleAl Boraq stops at Rabat Agdal
TangierTanger VilleModern station near the beach and city center; see where is Tangier
MarrakechMarrakech stationIn Gueliz, about 10 minutes by taxi from the medina
FesFes stationIn the new town, about 15 minutes by taxi from Fes el-Bali
MeknesMeknes Amir Abdelkader and El AmirClose to the new town
  • Air conditioning: available on main lines, sometimes very strong, so bring a light layer.
  • Food: Al Boraq has a snack bar. On other trains, a trolley may sell drinks and snacks, but bring your own water and food for long trips.
  • Toilets: available on all main trains, but bring tissues.
  • Luggage: racks above the seats and at the ends of the carriages. There are no strict luggage weight limits like on planes.
  • Wi-Fi and sockets: power sockets on Al Boraq; Wi-Fi is not always available or reliable.
  • Atmosphere: families, students and business travelers. People are friendly and often happy to chat.

Many travelers stay in riads inside the medina, where cars cannot enter. Here is how to get from the station to your door:

  • Take a petit taxi from the official taxi rank and ask the driver to use the meter, or agree on the price before you go.
  • Ask your riad for the nearest gate or parking spot, and send the address or location to the driver.
  • Ask your riad to meet you at the medina gate. Many riads send someone to guide you, which avoids getting lost.
  • Use a porter with a cart for heavy luggage in the medina, and agree on a small price first.
  • Book a private transfer if you arrive late at night or with a lot of luggage.

Trains are a great option for families and seniors because you can move, use the toilet and stretch your legs, unlike on long bus rides. Children under a certain age travel free or at a reduced price, and ONCF offers discount cards for young people and seniors who travel often. Big modern stations like Tanger Ville, Rabat Agdal, Kenitra and Casa Voyageurs have elevators and escalators, and Al Boraq has spaces for wheelchairs. Older stations and classic trains can have steps, so ask station staff for help if you need it.

  • Keep your bags close, especially in busy stations and on night trains.
  • Offer your seat to older people, pregnant women and parents with small children.
  • Be discreet during Ramadan: try not to eat or drink openly during the day out of respect for people who are fasting.
  • Ignore unofficial “helpers” at stations who offer to carry bags or find taxis and then ask for money.
  • Use official taxis outside the station and insist on the meter.
  • Keep your ticket until the end of the trip, as inspectors check tickets on board.
DestinationHow to get thereTip
Sahara (Merzouga, Zagora)Private tour, long-distance bus or carA desert tour from Marrakech or Fes is the easiest way
ChefchaouenBus or private transfer from Fes or TangierAbout 3 to 4 hours from Fes
EssaouiraSupratours or CTM bus from MarrakechAbout 3 hours
AgadirBus from MarrakechAbout 3 to 3.5 hours
Ouarzazate and Aït Ben HaddouBus, tour or private transfer from MarrakechOver the High Atlas, about 4 hours
Atlas villages (Imlil, Ourika)Taxi, transfer or day trip from MarrakechAbout 1 to 1.5 hours

ONCF works with the bus company Supratours, so you can sometimes buy a combined train and bus ticket, for example to Essaouira or Agadir via Marrakech. For the desert, mountains and villages, most travelers prefer a private tour with a driver, which saves time and lets you stop wherever you want.

OptionBest forProsCons
TrainBig citiesComfortable, safe, affordable, no trafficDoes not reach the desert, mountains or many towns
Bus (CTM, Supratours)Places without trainsCheap, many routesSlower, fixed times
Private driver or tourDesert, mountains, flexible tripsDoor-to-door, stops anywhere, local knowledgeMore expensive than public transport
Domestic flightsVery long distancesFastAirports far from centers, limited routes

The smartest plan for many travelers is to mix them: take the train between the big cities and book a private tour for the Sahara and the Atlas Mountains. This way, you save money on the easy routes and save time on the long, complicated ones. A private driver can also pick you up directly at the train station with a sign with your name, so you never have to look for a taxi with heavy bags. It is the most relaxed way to combine comfort, flexibility and budget, and it lets you see both modern Morocco and the wild landscapes that no railway will ever reach.

You can travel by train in Morocco all year round, but the experience changes with the seasons. Spring and autumn are the most pleasant: the countryside is green in spring, temperatures are mild, and trains are comfortable. Summer is the busiest season, with many Moroccan families traveling to the coast, so trains are often full and the air conditioning works hard against the heat inland. Read our guide to the weather in Morocco in August if you plan a summer trip.

Winter is quiet and a great time for city hopping by train, as long as you bring a warm layer for cool stations and early mornings. For a full overview, see our guide to the best time to visit Morocco.

Big changes are coming. In April 2025, construction began on a new 430 km high-speed line from Kenitra to Marrakech, passing through Rabat and Casablanca and serving the airports of Rabat and Casablanca. The plan is to open it by the end of 2029, before the 2030 FIFA World Cup hosted by Morocco, Spain and Portugal. When it opens, the trip from Tangier to Marrakech should become much faster, and a faster service between Fes and Marrakech is also planned. Studies for a future extension from Marrakech to Agadir have also been completed.

DayRouteTransport
Day 1Arrive in Casablanca, visit the Hassan II MosqueAirport train
Day 2Casablanca to Rabat for the day, then to TangierAl Boraq
Day 3Tangier to ChefchaouenPrivate transfer or bus
Day 4Chefchaouen to FesPrivate transfer or bus
Day 5Fes medina, optional trip to Meknes and VolubilisTrain or tour
Days 6 to 8Fes to the Sahara and on to MarrakechPrivate desert tour
Day 9Marrakech, then train to Casablanca for your flightAl Atlas + airport train

Want to visit Meknes and Volubilis from Fes? See our day trip from Fes to Meknes and Volubilis.

Our team takes trains in Morocco all the time. These are the 12 tips we share with every traveler:

  1. Book Al Boraq early for the best prices, especially on weekends.
  2. Use the official ONCF website or app and save your e-ticket offline.
  3. Check the station name carefully: Casa Voyageurs or Casa Port, Rabat Agdal or Rabat Ville.
  4. Choose first class for long journeys and busy days.
  5. Arrive 20 to 30 minutes early to find your platform and carriage.
  6. Bring water and snacks for long trips on classic trains.
  7. Pack a light jacket, because the air conditioning can be strong.
  8. Travel light or use luggage racks near your seat.
  9. Avoid Friday afternoons and Sunday evenings if you want quieter trains.
  10. Book couchettes early for the night train.
  11. Combine train and tour: train between big cities, private driver for the desert and mountains.
  12. Double-check times during Ramadan, when Morocco changes its clocks.
MistakeFix
Going to Casa Port for Al BoraqAl Boraq leaves from Casa Voyageurs
Not checking the station nameRabat and Casablanca have several stations
Buying second class on busy daysChoose first class for a guaranteed seat
No water or food on long tripsBring your own supplies
Planning a train to the desertThere are no trains to Merzouga; book a tour or bus
Missing the train because of the clock changeCheck the time during Ramadan, when Morocco changes time
Arriving at the last minuteArrive 20 to 30 minutes early, especially to buy tickets
  • Operator: ONCF
  • High-speed: Al Boraq, Tangier to Casablanca in about 2h10
  • Classic trains: Al Atlas to Marrakech, Fes and Oujda
  • Book: ONCF website or app, or at the station
  • Choose first class on long or busy trips
  • Night train: Tangier to Marrakech
  • No trains to the desert, Chefchaouen or Essaouira
  • High-speed to Marrakech planned by the end of 2029

Are trains in Morocco safe?

Yes. Trains are one of the safest and most comfortable ways to travel in Morocco. Keep an eye on your bags, as in any country.

Is the train in Morocco comfortable?

Yes. Main trains are air-conditioned and comfortable, and Al Boraq is modern and fast.

How do I buy train tickets in Morocco?

Online on the ONCF website or app, or at the station ticket office or machines.

Is there a train from Marrakech to Fes?

Yes. Direct Al Atlas trains take about 7 hours.

Is there a train to the Sahara Desert?

No. To reach Merzouga or Zagora, take a tour, a bus or a private driver.

Is there a train to Chefchaouen?

No. Take a bus or private transfer from Fes or Tangier.

How fast is Al Boraq?

Up to 320 km/h between Tangier and Kenitra.

Can I take the train from Casablanca airport?

Yes. A train connects the airport to Casablanca in about 30 minutes to Casa Voyageurs.

Should I choose first or second class?

First class for long trips and busy days; second class is fine for short journeys.

Is there a night train in Morocco?

Yes, between Tangier and Marrakech, with couchettes.

Do I need to print my train ticket in Morocco?

No. An e-ticket with a QR code on your phone is usually accepted. Save a screenshot in case you have no internet.

Are Moroccan trains on time?

Al Boraq is usually very punctual. Classic trains are generally reliable but can have delays, especially on long routes.

Want to combine the train with a desert adventure? Contact us and we will meet you at the train station in Marrakech, Fes or Tangier and take you to the Sahara.


Tours from Marrakech: Arrive by train in Marrakech and let our driver pick you up at the station. From there, we cross the High Atlas to the kasbahs and the Sahara, places no train can reach.

Morocco Desert Tours: The railway stops in the big cities, but the magic of Morocco continues in the desert. We take you from the station to the dunes of Merzouga for a camel ride and a night under the stars.

Tours from Fes: Reach Fes comfortably by train from Casablanca, Rabat or Tangier, then join a private tour through the Middle Atlas to the Sahara and on to Marrakech.

Tours from Ouarzazate: There is no train to Ouarzazate, so we bring you there by road over the spectacular Tichka pass, then on to the Dades and Todra gorges and the desert.

Tours from Tangier: Take Al Boraq or arrive by ferry in Tangier, and let us drive you to Chefchaouen, Fes and the Sahara on a route the railway cannot follow.

Tours from Casablanca: Land at Casablanca airport, take the train into the city, and start a private tour that combines the comfort of the railway with the freedom of the open road.

Name
Lahcen Saadi, a professional local guide from the Exploring Morocco Trips team, in traditional attire in front of a 4x4 in the Sahara dunes

Your Local Experts

Our Moroccan team organizes private tours from every major city in Morocco: Marrakech, Fes, Casablanca, Tangier, Rabat, Agadir, Ouarzazate and more. Wherever you land, we pick you up and design your trip around your dates and interests.

Scroll to Top