The actual distance between the airport in Boston and downtown is around 4 miles. If you’re a light traveler, you’re in luck and can into town at NO cost.
Head to the Silver Line (it’s actually a bus not a train) and that will take you to South Station which intersects with the Red Line. From there you can change to many other parts of the MBTA (Massachusetts Bay Transit Authority) – nicknamed T.
Here’s a travel planner to help you.
FYI – as of this writing, only Uber Black Car is allowed to pick up at the airport. My last trip cost over $30.