How to Book Train Tickets in Morocco: The ONCF Guide
The Moroccan train system is in fact one of the best methods for a single traveler to get around the country, offering comfort, attractive views, and reasonable prices. A surprising number of tourists, though, encounter difficulties when trying to book a ticket before they even leave home, primarily due to a particular problem that has been well documented with the official booking system. The following explains exactly how the network operates and how you can actually end up with a ticket without having to go through frustration.
Morocco’s Two Main Train Types
The national railway company of Morocco, ONCF, operates a network that extends over 4,000 kilometres and links all the main cities. Two kinds of train are worth mentioning. Al Boraq is Africa’s first high speed line having been put into operation in 2018 and runs at speeds of up to 320 kilometres per hour between Tangier, Kenitra, Rabat and Casablanca, taking about two hours ten minutes to go from Tangier to Casablanca and only eighty minutes from Tangier to Rabat. It runs approximately once an hour, provides reserved seating throughout and has a cafe bar car, which is a genuinely pleasant way to spend the journey. Al Atlas is the standard network serving the rest of the country, including Marrakech, Fes, Meknes and Oujda, with a maximum speed of 160 kilometres per hour; it has snack trolleys on board and the air conditioning may be unreliable during Morocco’s hot summer months, so if you are traveling in peak summer a seat in a compartment marked “Climatisé” and on the side of the train opposite the direct sun will give you a considerably better experience.
A number of the longest routes in Morocco, particularly those between Marrakech and Tangier, are operated on an overnight basis and should be taken into account if you prefer to sleep during a long journey rather than spend the day sitting on it.
What It Actually Costs
The price depends on the route and how far in advance you book, though as a general rule second class tickets on standard routes begin at about 5 euros, first class at about 10 euros and Al Boraq tickets at about 28 euros. On shorter routes, for example between Casablanca and Rabat, the difference between first and second class is not very significant since the journey is short regardless of the class chosen. On longer trips, first class does provide real extra comfort and the small extra cost is worth it. Children between the ages of 0 and 3 travel for free. Booking becomes available six months before departure, and it really is helpful to book early on popular routes around weekends and holidays when second class tends to fill up quickly.
The Problem Most Foreign Travelers Hit
The section that few general travel guides make clear is worth knowing well before you attempt to book. The ONCF official website, oncf-voyages.ma, is geoblocked for a large number of countries and so may completely fail to load depending on your location. Moreover, and more annoyingly, even when the site does manage to load, its payment gateway is based on the verification of Moroccan cards and often rejects credit and debit cards issued outside Morocco; this is not an issue with your card, it is due to the gateway’s fraud detection settings not correctly recognising the formats of non-Moroccan cards. This situation affects a truly large proportion of North American and European travellers who are trying to book in advance.

How to Actually Get Your Ticket
There are a number of dependable alternatives available in this situation, and the one you choose will depend on how far in advance you are booking and on the amount of hands-off convenience you desire.
Arrange your tickets through a third-party website. Websites that are dedicated to the reselling of ONCF and Al Boraq tickets, as well as general international rail booking sites, accept standard foreign cards without requiring the usual domestic verification, and usually provide an entire English language checkout process. This is the most reliable method if you want to secure a ticket before you arrive.
You should download the ONCF Voyages app. As the official application, it is offered in Arabic, French and English and uses the same booking system as the website allowing you to manage your tickets, use discount cards and download an e-ticket to your phone. It is satisfactory for a great many travelers, although some mention a rather cumbersome sign-up procedure, especially concerning the way in which phone numbers are formatted for non-Moroccan numbers, so a bit of patience is advisable on your first try.
Set a VPN to a country in Europe. Although it is not guaranteed, people who have travelled have found that using a French or Spanish IP address makes the ONCF website more likely to accept a foreign card, since it alters the way the payment gateway interprets the transaction’s origin. There is no cost involved in trying this before paying a markup elsewhere.
You can just buy the tickets in person. At ticket counters located at the major stations, including that at Casablanca Mohammed V Airport, tickets are sold on the spot and both foreign cards and cash are accepted without having to go through the online process. For people flying into Casablanca, it is genuinely a simple idea to purchase your first connecting ticket there before you leave the airport, and it serves as a good alternative if you have problems with online booking.
Our Honest Recommendation
When it comes to booking your first ticket, particularly if you’re arranging it from outside Morocco before your visit, using a third-party booking platform is the easiest option since it provides an English checkout, allows you to use foreign credit cards and gives you an e-ticket ready to use, all without the need to deal with the official website. After you have arrived in Morocco, the station ticket counters offer a fully reliable alternative for purchasing further tickets, and the ONCF Voyages app then proves to be genuinely useful for checking timetables and managing the tickets you already have.

A Note From Living Here
The trains are excellent and the whole of this section has been introduced solely as a result of a quirk in the payment gateway, not because there are any problems with the actual travel experience; after your ticket has been arranged, the rest of the journey is just comfortable and scenic.
Quick Answers
The ONCF website won’t take my card because the payment gateway is based on the verification of cards issued in Morocco and often turns down those that are issued elsewhere; this is a known problem with the gateway and not due to any issue with your card.
How does Al Boraq differ from Al Atlas? Al Boraq is the high speed line which links Tangier, Rabat and Casablanca at a speed of up to 320 kilometres per hour, whereas Al Atlas is the conventional network that extends to the rest of the country, including Marrakech and Fes, at a maximum speed of 160 kilometres per hour.
You can book Morocco train tickets as far in advance as six months before your departure date, and it’s advisable to do so if you’re travelling on popular routes during weekends and holidays.
Once I have arrived in Morocco, can I purchase a train ticket? Yes, ticket counters at the main stations, such as that at Casablanca Mohammed V Airport, offer tickets immediately and take both cash and foreign cards.
Is it worth paying for first or second class on the trains in Morocco? On short routes the difference doesn’t matter very much, but on longer journeys first class does provide real extra comfort and is usually worth the small difference in price.

