Groton is a town in northwestern Middlesex County, Massachusetts, United States, within the Greater Boston metropolitan area. The population was 11,315 at the 2020 census. It contains the census-designated place of the same name. An affluent bedroom community roughly 45 miles from Boston, Groton has a large population of professional workers, many of whom work in Boston's tech industry. It is loosely connected to Boston by highways (Route 2) and commuter rail (the MBTA Fitchburg Line).