Ashby is a town in Middlesex County, Massachusetts, United States. The population was 3,074 at the 2010 census.According to the United States Census Bureau, the town has a total area of 24.2 square miles (63 km2), of which 23.8 square miles (62 km2) is land and 0.4 square miles (1.0 km2) (1.53%) is water.
Ashby was first settled in 1676 and was officially incorporated in 1767.The library is a public library, founded in 1874 "largely through the efforts of Rev. George S. Shaw." In the 1890s it was "kept in a private house" open to the public Tuesday and Friday afternoons.Around 1890 the Ashby library had "1,584 volumes, with which its inhabitants have a pleasant and profitable acquaintance." In 1901 businessman and Civil War veteran Edwin Chapman donated a new building, which opened in 1902.