Humberto Delgado Airport, Lisbon: Rent a car at the airport or pre-book a private transfer: Comporta village is roughly 1 hr 20 min–1 hr 40 min by road, usually via the A2 and Alcácer do Sal. Expect about €130–180 for a one-way private transfer; a rental car is the better value if you plan to see more than one beach. Do not assume there is a useful airport-to-Comporta public-transport link: connections are sparse and turn a short drive into most of a day.
Setúbal rail station: Useful only if you are already arriving by train from Lisbon and have arranged a car pickup or transfer. The Lisbon–Setúbal train is roughly an hour and about €5–7, but Setúbal is still around 75–90 minutes by road from Comporta; budget roughly €100–140 for a pre-booked transfer. The Troia ferry can make a scenic route with a car, but it is not the painless option with luggage or without confirmed onward transport.