Water supply and sanitation in Gibraltar have been major concerns for its inhabitants throughout its history, from medieval times to the present day. The climate of Gibraltar is a mild Mediterranean one with warm dry summers and cool wet winters. Since daily records of rainfall began in 1790, annual rainfall has averaged a mean of 838 millimetres (33.0 in) with the highest volumes in December and the lowest in July. However, most of Gibraltar's small land area is occupied by the Rock of Gibraltar, a limestone outcrop that is riddled with caves and crevices. There are no rivers, streams, or large bodies of water on the peninsula, which is connected to Spain via a narrow sandy isthmus.
Gibraltar's water supply was formerly provided by a combination of an aqueduct, wells, and the use of cisterns, barrels and earthenware pots to capture rainwater. This became increasingly inadequate as Gibraltar's population grew in the 18th and 19th centuries; the settlement was a breeding ground for lethal diseases such as cholera and yellow fever, which killed thousands of its inhabitants and members of the British garrison in repeated outbreaks. In the late 19th century, a Sanitary Commission instigated major improvements which saw the introduction of large-scale desalination and the use of giant water catchments covering over 2.5 million square feet (nearly 250,000 m2). Today Gibraltar's supply of drinking water comes entirely from desalination, with a separate supply of saltwater for sanitary purposes – both supplies are delivered from huge underground reservoirs excavated under the Rock of Gibraltar.
Gibraltar was uninhabited during ancient times due in part to a lack of easily accessible water to support a permanent population, but in the 11th century the Moors established a fortified stronghold there in response to military threats from the Christian kingdoms of Aragon and Castile. The Moors obtained water through roof catchment of rainfall, shallow wells in the Quaternary sands to the west of the Rock of Gibraltar, and storing local surface runoff in cisterns. In the 14th century they constructed an aqueduct that collected water from the Red Sands, an area south of the town in the vicinity of what is now the Gibraltar Botanic Gardens, and transported it some 1,350 metres (4,430 ft) to a fountain within the town. Fountain Ramp, on the western side of John Mackintosh Square, preserves in its name the location of the aqueduct's original terminus.