Rye is a town in Rockingham County, New Hampshire, United States. The population was 5,298 at the 2010 census. The town is home to several state parks along the Atlantic coastline.