A man refills water bottles in Cape Town, South Africa. February 14, 2018. (Charlie Shoemaker for The Washington Post)

Ashley Dawson is a climate activist and professor at the City University of New York. His latest book is “Extreme Cities: The Peril and Promise of Urban Life in the Age of Climate Change.”

A person can survive only about three to five days without access to water. What about a city? This is not a hypothetical question: The thirsty city threatens to be the most dire social crisis of the 21st century.

Cape Town, where I was born, is the first major city to face a water crisis of epic proportions. For a few months in late 2017 and early 2018, it looked like Cape Town would run out of water. Due to the conservation efforts of Capetonians, Day Zero — the doomsday moment when the city’s taps would run dry — was successfully staved off, first to April 2018 and now for the foreseeable future. Yet with ever more severe climate change looming, the city of 4 million will face a reckoning sooner or later. And it will not be alone.

The majority of humanity now lives in cities. Urban growth increases the demand for water, overtaxing infrastructure as millions of people crowd into concentrated spaces with limited supplies of fresh water. Some of the fastest growing cities are in areas with limited access to fresh water. And many of these cities are located in regions particularly susceptible to the impacts of climate change, which in many places means higher temperatures, more heat and evaporation, and more demand for water.

So what lessons can cities around the world learn from Cape Town’s water crisis? First, planning for a drier future needs to be comprehensive, integrated and realistic.

Cape Town is not an arid city — in fact, the surrounding mountains get nearly five times as much rain as Los Angeles. But over the last three years, precipitation dwindled to the lowest levels ever recorded. As the gravity of Cape Town’s water crisis became clear ten months ago, the city announced an ambitious but unrealistic plan to provide additional sources of water — mainly from desalination and groundwater — within six months. The grand engineering plan could not be executed in such a short timeframe.

Instead, the city ended up having to take a more on-the-ground approach. It lowered water pressure, raised water taxes and prodded Capetonians to cut their water usage by more than half. Stringent restrictions on water use and public education campaigns had an effect: Consumption dropped by 25 percent within the course of a few months. But it was not enough. By the end of 2017, only a third of users had successfully cut their water use to meet tight government targets of 23 gallons per day.

To cajole particularly water-wasteful households into conforming to the voluntary restrictions, Cape Town’s mayor began visiting excessive consumers in person. Ironically, this public shaming strategy highlighted the yawning disparities in South African society, since excessive consumers were concentrated in the city’s wealthy and predominantly white neighborhoods.

This brings us to the second lesson to be drawn from the Cape Town water crisis: Access to water is usually uneven, and water and social justice are consequently intimately connected.

When South Africa wrote its new constitution after the end of apartheid, it guaranteed water as a human right. Yet municipalities such as Cape Town never extended the city’s water infrastructure to the populous, lower-income informal settlements of the city. The crisis in Cape Town is therefore not simply about scarcity: It is a product of water apartheid and must be addressed as such.

These informal settlements — known as townships — rely on free but scarce communal taps. The work of queuing for this water, and then lugging it home, falls disproportionately on women and children in the townships. Although roughly half of Cape Town’s population lives in townships like Khayelitsha and Gugulethu, these Capetonians consume only about 5 percent of the city’s total water supply.

When it became clear that Cape Town could afford neither the time nor construction costs to build large-scale desalination plants, the city dispatched staff to poor neighborhoods, conducted surveys and fixed leaks and faulty systems, free of charge. Globally, it is estimated that up to a third of water supplies are lost due to leakages. While fixing such leaks and encouraging conservation and recycling is not a substitute for comprehensive engineering solutions, they do offer an important complement.

While these efforts were a good start, Cape Town’s government has historically focused on developing the city’s affluent (and almost exclusively white) areas, which drink up far more than their fair share of water. As the water crisis has worsened, residents of these areas have been drilling for their own private supplies of fresh water, turning them into the so-called borehole bourgeoisie. Though the government did not ban such borehole drilling, plans to deploy the South African National Defense Force to water distribution sites suggested that the specter of serious unrest over unequal access to water was on officials’ minds as they anticipated Day Zero.

Public anger over water apartheid has also been sparked by big bottling companies like Coca-Cola, which draws the water it uses to make soft drinks and bottled water from city sources. Members of the Cape Town Water Crisis Coalition, which includes township residents who cannot afford bottled water, called on city authorities to force powerful private entities who use a lot of water, including bottling corporations and big farms, to either cut back production, pay more of their water or give some of it back to the community.

To combat water apartheid, inclusive and democratic frameworks for governance of dwindling water resources must be established. This means rejecting privatization of municipal water supplies and challenging the powerful interests that benefit from privatization. Only when water is controlled by a democratically governed entity can cities be held accountable for providing clean water for all.

The way that humanity currently uses water is unsustainable. Ominously, it is the world’s largest cities, so-called megacities like Beijing, Delhi, Karachi, London, Los Angeles, Mexico City, Rio de Janeiro and Tokyo, that are the most water stressed. Solutions need to be oriented around the idea of water as a human right and a common good rather than a commodity accessible only to the rich. Only by democratizing access to scarce water supplies will we avoid a future in which the world’s cities are reduced to incendiary wastelands.

This was produced by The WorldPost, a partnership of the Berggruen Institute and The Washington Post.