The vast majority of tourists arrive to Greece via the Athens airport. But rarely passengers will arrive at Athens via boat or cruise ship. In that case, your boat will dock either at the ports of Piraeus, Rafina, or (rarely) Faliro.
From Pireas, you can catch the HSAP train at the Pireas station that connects with all the Metro lines, so you can easily reach the center of Athens. Depending on the location of your ferry, you might have to walk a long way to get to the station.
The boats that connect with the Dodekanesse islands and Crete dock far away from the station, and you might want to take a five minute taxi ride instead of a twenty minute walk in the heat.
Other boats dock much closer to the station so walking to it should not be an issue.
If you arrive to Greece via ferry from Italy, your best bet would be to disembark in the town of Patra. From there you can take a bus to Athens.
The ferry companies offer their own bus service and you can buy tickets at the ferry reception area during your trip.
If you prefer the public bus lines, you would have to take a taxi from the port of Patra to the bus station and wait for the bus to depart. Click here to see the Piraeus port on the map
If you arrive to the port of Rafina you would need to hire a taxi to take you into Athens.
It’s a half-hour drive but it can take double and triple that time if you encounter traffic.