Make sure you have a valid passport.
Decide how you will travel, and for how long. You can travel by airplane or ferry.
Choose your departure and arrival cities. You can fly to Nador, Morocco, from Barcelona, Spain; to Fez, Morocco, from the Spanish cities of Barcelona, Seville or Alicante; to Tangier or Casablanca, Morocco, from Madrid, Spain; and to Marrakesh, Morocco, from Madrid, Alicante, Barcelona or Seville.
By ferry, you can travel to Tangier, Morocco, from Barcelona, Tarifa or Algeciras, Spain; or to Nador, Morocco, from Almeria, Spain.
Book your travel. For air travel, Ryanair offers inexpensive flights between most of the above cities. If you are traveling between Madrid and Marrakesh, flights are available from EasyJet, Iberia, Air Europa, Atlas Blue and Royal Air Maroc. All airline tickets can be purchased online from the carriers' websites.
Ferry tickets can be purchased at the port from the ferry company, or from an outside online booking agent such as Frs.es or Aferry.com. Your easiest option would probably be to call for a reservation: 011+39-010-5731805.
Enjoy Morocco.