Mariehamn is most commonly reached by the Viking Line or Silja Line ferries from Stockholm (six hours, overnight) or Helsinki (twelve hours, overnight), which stop at the eastern harbour. The overnight crossing from Stockholm is the classic approach and the most atmospheric — you pass through the Stockholm archipelago as you leave and arrive through the Åland outer islands in the morning.
Mariehamn Airport, 4 km from the city, has regular flights to Helsinki and Stockholm. Finnair and Nextjet (subject to schedule changes; verify current operators) serve these routes. The flight time is short enough that the ferry is often preferred for the experience.