The train station to get the trains to the festival is Cais de Sodre, down by the water. Trains are very regular (several per hour) out and back to the festival, which is c. 4 stops/10 minutes along this line at Alges. Buy your multitrip train card (Viva Viagem) in the station at a kiosk or from a machine - try and do this early in the day (or even the day before) as the lines are long within a few hours of the gates opening. You can load this up with more trips as required during your stay.