The Piraeus metro station is located directly opposite the port entrance near gate E5. Use the crosswalk or the brand new pedestrian overpass to cross the street to the port. The main ticket booths will be to your left once you pass through the gate but their are several other ticket kiosks spread about the port.