I took a train at 10.55 a.m. with the final station being Beni Nzar port, which was literally couple of meters from the Moroccan-Spanish border. The train ride was a pleasant one, with one change in Tourirt at about 2 p.m., and I arrived little after 5 p.m.
The other trains in the direction of Nador/Beni Nzar leave in the middle of the night, all of them being seating trains.
The boat is probably the most ideal way to arrive in Melilla as the port delivers you into the centre of the town. The airport is about 3k away. There are two boats: a "fast" catamaran type boat which takes 4 hours to cross from Malaga, and a slower ferry which takes nearer 7 hours, but on the slow boat you can go out on deck to amuse yourself or take a sleeper cabin. I have used Trasmediterraneas Spanish website because it is actually easier to understand than the Direct Ferries website we found. However, you can just put Malaga to Melilla ferries into a search engine to get results if you prefer.
For visiting Melilla, even crossing to Maroc, the best thing that you can do is renting a car.
There are at least two car hire companies in Melilla:
Melicar Alquiler de Coches S.L. in Cargadero del Mineral, s/n (+34 952670880)
Rent a Car Melilla S.L. in Calle Pablo Vallescá, 16 (+34 952686122)
Altough you have buses too and your own feet, because Melilla is very little!!
The fastest way for arriving Melilla is taking a plane in the Peninsula. There are daily flights from Madrid (3 daily flights although saturdays there are only one), Barcelona (1 daily flight), Málaga (4 daily flights but in weekend only 3), Granada and Almería (at least one daily flight)
The company who fleets the planes is Air Nostrum (belongs to Iberia).
The most romantic way for arriving Melilla is taking a boat in mainland Spain. There are two lines from the Peninsula: Málaga-Melilla and Almería-Melilla.
From Málaga there is a daily ferry (it tooks between 7 & 8 hours) and in the summer time there are 3 "high speed hydrofoils" (the travel tooks in this way only 4 hours)
From Almería there is a daily ferry too (it tooks between 6 & 7 hours)
Iberia/Air Nostrum operates 50 seat Dash 8-300 and Fokker 50 aircraft to Melilla. The airline receives government subsidies to serve Melilla so the fares are lower. There is no bus to the airport. However, if you have a light suitcase, you can walk to the Barrio Real and catch a bus for 50 cents. It is a 20-30 minute walk.
Sometimes, the Iberia website offers last minute airfares from Malaga to Melilla for 70 euro return.
The lastest way for arriving Melilla is crossing the border from Morocco as moroccan workers and merchants do.
You can done it with a car or even walking.