Melilla is reached by air or by sea. There is no land crossing from Spain — the border with Morocco is the only land connection, and that leads into Morocco, not peninsular Spain.
By air: Melilla Airport (MLN) is served by regular flights from Madrid and Málaga operated by Iberia and Air Nostrum. The flights are short — about an hour from either city — and surprisingly affordable. The airport sits right on the edge of town, a few minutes from the centre by taxi.
By ferry: Baleàría and Trasmediterránea run overnight and daytime ferries from Málaga and Almería to Melilla. The crossing takes 6–8 hours overnight from Málaga. This is a classic option if you want to bring a car or enjoy the sea passage; the ferries are comfortable and well-run.
From Morocco, the Beni Enzar border crossing is open daily and taxis run from the Moroccan side into Nador and on to the rest of Morocco.