Train travel in Morocco is comfortable, affordable and easy to navigate. The only downside is that the railway network is fairly limited, so it’s really only the best option for certain stretches. As a train fan I’d still recommend the train, but it’s often faster to catch a direct bus. So there’s still work to be done when it comes to train travel in Morocco. But if you do fancy taking a train on your next trip to Morocco, here you’ll find all the information.
The Moroccan railway overview
Morocco’s railway network is run by ONCF (Office National des Chemins de Fer). The network lies mainly in the north and west of the country and was historically built up around economic and logistical connections, not tourist routes.
The main railway line runs from Tangier in the north to Marrakesh in the south. This is the backbone of the network and where by far most trains run. Along this line lie major cities such as Rabat and Casablanca, but also smaller towns you can easily use as a stopover. One example is Asilah, a small coastal town that sits directly on this main route and is therefore a popular day trip from Tangier.
From Tangier to Casablanca: the most modern part of the network
The route between Tangier, Rabat and Casablanca is the most developed part of train travel in Morocco. Here both regular trains and the Al Boraq high-speed trains run. The journey takes roughly 2 to 5 hours (high-speed/regular train).

The high-speed trains are modern, quiet and fast. They have fixed seats, good air conditioning and clear signage at the stations. This part of the network feels the most “finished” and is, for many travellers, the most pleasant way to cover long distances. The route runs along the coast, with views of the Atlantic Ocean. This is also the most logical part of the route, since Tangier and Casablanca both lie on the coast and are therefore easily connected. You can continue from Casablanca on to El Jadida, the final stop on the line, but not every train goes all the way there.
The stations on this route are also well equipped, with cafés, shops and clear information boards.
From Tangier to Fes
For the train from Tangier to Fes, you take a train that eventually heads inland rather than towards Casablanca. You pass through Meknes, and after Fes you can continue on to Oujda, a small town on the border with Algeria. Since you can’t cross that border overland, the railway stops there. Unfortunately it isn’t possible to travel overland from Morocco to Algeria.
You can either choose the direct train, or take the high-speed train to Casablanca and then change to the train to Fes. That train takes around 4 hours. So that’s a total of 6.5–7 hours with a change, or about 9 hours on the direct train.
The nighttrain from Tangier to Marrakesh
Anyone doing the full north-to-south route can do so overnight. The night train from Tangier to Marrakesh is the only night train in Morocco and runs daily. The train usually departs Tangier around 23:30 and arrives in Marrakesh just after 09:00. In the other direction it departs Marrakesh around 20:00 and arrives in Tangier early in the morning.
The night train consists of ordinary seating carriages and a limited number of sleeper compartments. Those couchettes are fairly basic but surprisingly practical: usually four berths per compartment, with sheets, a pillow and a light blanket included. Sometimes there are also two-person compartments or private cabins, but these are scarce and not always available. There are generally only one or two sleeper carriages per train, so they sell out quickly, especially during holiday periods.
Booking online is a bit of an adventure in itself. Ordinary seats are easy to book via the ONCF website, but couchettes often don’t appear there, or only to a limited extent. Many travellers therefore buy their sleeper ticket directly at the station, where paper tickets are still used. Booking ahead is therefore the most sensible approach.
The comfort level remains basic: older carriages, limited power sockets and regular stops in the middle of the night. But it’s precisely that slow, old-fashioned character that makes the journey memorable for many travellers. You save a night’s hotel and don’t lose a whole day to travelling, while waking up on the other side of the country.

From Casablanca to Marrakesh
Coming from Tangier and want to get to Marrakesh, but not on the night train? Then you change in Casablanca onto the direct train to Marrakesh. The train often costs only €10–15 and is a 3-hour fast train (not high-speed, but perfectly fine). This is probably the most popular route for tourists, since Marrakesh is Morocco’s most popular city-break destination, and many international flights go to Casablanca. Flying into Casablanca and taking the train to Marrakesh can also save you quite a bit of money from the Netherlands. I’ve saved money this way myself too.
Marrakesh is the end of the line for trains in Morocco. No trains run south of Marrakesh, so you’ll usually change onto a bus or taxi there.
Safi: the last train in Southern Morocco
From Marrakesh there is one more railway line, running to Safi, a small coastal town on Morocco’s west coast. Safi is therefore reachable by train, but only from Marrakesh, and unfortunately with just two trains a day.
This railway line was originally intended for freight traffic, mainly for transporting sulphate from Safi to surrounding areas. After local campaigns, a passenger train eventually started running on this route too. Because the line is still mainly used for freight, there are only 2 trains a day. I took that train myself and it was nowhere near full, so there doesn’t seem to be much demand for more trains between Safi and Marrakesh. Plenty of people still take the bus instead. The people of Safi would nonetheless like to be better connected to the rail network. There’s a campaign running to extend the railway line from Tangier to El Jadida onward to Safi (which lies a bit further south). This would connect it to the main network, making Safi considerably more accessible and potentially more popular with tourists.
The train from Marrakesh to Fes
The train from Fes to Marrakesh runs through Casablanca. It’s a long journey but you don’t have to change trains You don’t need to change trains. The total journey takes around 7–8 hours.
The possible stops in Morocco

Beyond these major cities there are, of course, plenty of small towns along the route. I already mentioned Oujda, right in the north-east of Morocco. This isn’t a popular destination for the average tourist, and it’s actually advised against in the official government travel advice, since it lies close to the border with Algeria, and the two countries aren’t exactly on friendly terms. You could also choose to go from Fes to Nador, which lies on the north coast. Again, not very popular among tourists, but this region is popular in summer with Moroccans living in Europe, many of whom originally come from this area. Along the route you’ll find several small towns and villages, where you’re really among the locals. There are also a number of lovely villages between Tangier and Rabat, such as the charming little town of Asilah (photo).
Do pay close attention though, as many trains only stop at the major stations. To make sure there’s actually a train going, and a train coming back, it’s worth checking with ONCF or in their app.
Destinations without a rail connection
Many popular destinations in Morocco aren’t reachable by train. Well-known examples include Essaouira on the coast and Imlil in the mountains, but also, for instance, the desert or the large city of Agadir. I don’t actually know the exact reason why expanding the rail network isn’t a priority in Morocco, but the easiest way to get around Morocco is really by bus or, alternatively, by shared taxi.
Tourists often travel with a guide, particularly on the route from Marrakesh to the desert, which most tourists don’t do independently. There are endless organised tours and tour operators offering this route as a 3-, 4- or 5-day mini trip. The route can also be done by bus or taxi, but the bus usually only runs once a day and you’re stuck with early departure times because of the long distance. A private trip gives you more freedom. For a budget option you can do a group trip with a number of stops along the way, such as Aït Ben Haddou.
For a day trip to Essaouira or Imlil I’d recommend the tour operator Atlas Dream. They focus on working with local people, authentic experiences and leaving a positive impact. This can even include a delicious homemade lunch with the owners family, to recharge from your hike in the mountains.
They do many more tours, including a women only adventure. Can’t find what you’re looking for or you’re working with a different kind of budget? Then check out platforms such as GetYourGuide or Viator. For a desert trip I’d recommend a 4- or 5-day tour, so you actually get 1 or 2 full days in the desert. With the 3-day tour you only get one night, arriving at the desert camp around sunset and setting off again at 9 a.m. the next morning.
Train stations and transport into town
Train stations in Morocco are often not located in the centre of town. You’ll usually need to take a taxi to or from the station. This makes it a slightly less attractive mode of transport, and even I, as a train enthusiast, am not the biggest fan of trains in Morocco because of it. Often you can take a shared taxi for the same price, especially on shorter routes such as Marrakesh to Safi. That saves you a change and barely costs any extra time. Only the high-speed line between Tangier and Casablanca is significantly faster.
If you do take a train and a private taxi to the station, bear in mind that taxi drivers in Morocco are notorious for trying to rip off tourists, so make sure you know what a ride to the station is actually worth, to avoid paying three times the price of your train ticket. You can read all about taxis in Morocco here. From the station into the centre you’ll usually share a taxi with others, which is cheaper.

Buying tickets and prices
You buy train tickets in Morocco through ONCF, online or at the station. Note: the website often doesn’t work outside Morocco, so if you want to buy tickets in advance, you’ll need a VPN, or you can try downloading the app. You can pay with international credit cards, though you’ll pay a few cents extra for this.
Train tickets in Morocco have a fixed price, so it doesn’t get more expensive if you book late. You do have assigned seats on Moroccan trains though, so once it’s full, it’s full. Even so, plenty of locals simply buy their train tickets at the station just before departure, and I never really got the impression that trains are often genuinely full. The only exception was the train from Fes to Casablanca, which was very busy, but by the time we reached Marrakesh there was hardly anyone left.
External platforms such as Railninja, 12Go and Omio are reliable, but usually considerably more expensive. Railninja can be almost twice as expensive. 12Go and Omio are the best options if you still want to book in advance and the ONCF website isn’t working. You can also find up-to-date journey times here, which is handy for planning in general. And they show bus options directly too.
Trains in Morocco are cheap, often only €10–20 for a journey of a few hours in second class; first class is at most double that. High-speed trains are a bit more expensive, so you can choose the longer route to save money. Even the night train is around that price, although a sleeper compartment is of course more expensive — often double, and sometimes rising to around €65.
Food, drink and stations
On many trains, vendors walk through selling snacks such as nuts, biscuits, crisps and water. This is handy, but not guaranteed, and the range is limited. For longer journeys it’s therefore a good idea to bring your own food and enough water. Practically every station has at least a café. Larger stations also have shops and several places to eat.
Boarding, seating and luggage

On many trains you have an assigned seat. This is shown on your ticket and you’ll already see it when booking. (If it’s quiet, you’re welcome to move seats. But bear in mind that someone may board later and ask you for that seat.) The carriage number is clearly marked on the outside of the carriage. At smaller stations the boarding time can be short. Sometimes the platform shows where each carriage will stop, so you can already stand in the right spot and board straight away. Luggage space is limited. Each compartment usually has only one luggage rack plus space above the seats. On older trains these are the only racks available. Travelling light is therefore advisable. At some stations you can leave your luggage in lockers if you want to make a stopover somewhere. Not available? Then check platforms such as Radical Storage for, for example, a hotel nearby where you can leave your luggage for a small fee.
Comfort and differences between trains
Trains in Morocco vary considerably. Some are old-fashioned, with closed-off compartments and little ventilation. Others are more modern, with 2-and-2 seating and air conditioning. The high-speed trains are always modern. On other routes it’s a bit of a lucky dip as to what you’ll get. It’s a good idea to wear layers, so you’re prepared for both heat and cold air conditioning.
Sometimes, for instance, there’s no air conditioning but there is a window. Though that’s not much help either when it’s 45 degrees outside. You’re best off avoiding the toilets, but that’s fairly universal on trains in general. Luggage space is the trickiest bit, in my opinion.
Prefer to travel with an organised tour?
So I travelled around by train, and as I said, sadly it isn’t the best way to get from A to B in Morocco. Although travelling solo in Morocco is very doable, buses and shared taxis are plentiful, and I personally found it a safe country, it does take a bit of navigating. Reading all this and thinking “ugh, this all sounds far too complicated for a week’s holiday”? Good news: I take people on group trips! Sign up for my newsletter and stay up to date with the plans.






0 Comments