KYIV -- When Russia launched its massive invasion of Ukraine on February 24, the residents of Myrnohrad knew what they needed to do: Start digging.
The small city, which sits within artillery range of Russian forces in eastern Ukraine, endured six months without water in 2014, after the war between the government and Kremlin-backed forces erupted in the region known as the Donbas.
Residents then spent a few winter weeks shivering after fighting in early 2015 damaged water systems that fed into boilers, according to Denys Tomaz, head of the city department of investment and innovation. Since then, the city has been making contingency plans, including working to turn groundwater seeping through defunct coal mines into a source of potable water.
"We understood that it could happen again," Tomaz said by phone from Myrnohrad. The government has been drilling wells across the city and even helping residents dig their own.
While Myrnohrad has so far avoided significant damage, many other frontline cities are not so lucky.
Attacks on water infrastructure and the movement of residents fleeing their homes have left as many as 13 million people across Ukraine needing assistance with water, sanitation, and hygiene, according to a July UN report. Areas without safe access to water could face outbreaks of cholera, hepatitis, scabies, and other potentially deadly diseases, the UN said.
Children are particularly vulnerable. Polluted water and unsanitary living conditions kill children more than 20 times more frequently than violence in countries experiencing an extended conflict, according to a 2019 UNICEF report.
Ukraine's problems with water have been most acute in Russian-controlled Mariupol, on the Azov Sea coast in the Donbas, and Mykolayiv, which lies further west and remains in Ukrainian hands.
Russia's attack on Mariupol, formerly a city of 430,000 people, began on the first day of the invasion. By March 2, the assault had destroyed the main canal for drinking water and the auxiliary water supply. Over three months of grinding siege conditions, all 22 of the city's pumps were destroyed, according to the city government.
Residents were forced to drink rainwater and smash heating systems to extract the water to wash their hands, according to Human Rights Watch.
Russia appears to have done little to restore access to safe water following its occupation of the city in mid-May, putting the remaining 100,000 residents at risk of waterborne illnesses. As of early July, just 5 percent of homes were connected to water sources, according to a social-media channel run by Petro Andryushchenko, an adviser to the mayor of Mariupol who is currently outside the city.
Even this water may be too dangerous to use. On July 18, analysis showed that water from the city had dangerous levels of a bacteria associated with fecal matter, according to a report issued by officials from the displaced Ukrainian city administration.
The city is at particular risk of a cholera outbreak, having experienced one even before fighting between Ukraine and Russian-backed separatists broke out in 2014. In June, the World Health Organization warned of a potential cholera epidemic and said it was prepositioning supplies to aid the city.
Mykolayiv, a port city on a river that flows into the Black Sea just west of Russian-held Kherson, lost its water supply completely when Russian forces damaged the Dnipro-Mykolayiv water pipeline in mid-April. The city has since restored water access, but the water that flows through the pipelines is unfit for human consumption due to its salt content, according to Oleksiy Burak, an installation manager for Water Mission, a U.S.-based NGO.
The city has dug wells, but finding drinking water is still a problem. Burak's group has focused on hospitals, where clean water can be a matter of life or death. "People are on dialysis," Burak said. The water "has to be almost distilled" for their use.
The situation in the Donbas, the site of very heavy fighting since the February invasion and particularly in the last few months, is perhaps the most precarious. Much of the water in the Donetsk and Luhansk regions comes from the Siverskiy Donets-Donbas Canal, which runs 133 kilometers through both Ukrainian and Russian-held territory.
Unrepaired damage from shelling has left some villages without running water since 2014, according to UNICEF.
The Donbas also suffers from a range of ecological issues, including groundwater contamination due to mine water and even radioactive contamination stemming from a Soviet underground nuclear test in 1979, according to a report from the Eurasia Daily Monitor.
It is unclear where the money to repair Ukraine's water infrastructure will come from -- if it comes at all.
Restoring access to water is expensive, at a time when the country is already facing severe economic distress. One UN report put the total cost of repairing water infrastructure at almost $75 million before the Russian invasion, with over half of that cost coming from the battle-worn Donetsk region.
Shorter-term emergency measures can also be costly. A single water-filtration system might cost as much as 7,000 euros plus installation and other costs, according to Mykhaylo Amosov of Ecoaction, an environmental NGO that is helping communities regain access to water.
Towns must also spend money on generators, as the damage caused by war can knock out the electricity needed to run water-filtration systems, according to Myrnohrad official Tomaz.
Local organizations are learning as they go. Ecoaction, for example, has links to other environmental activists in Europe, but it does not have support from more deep-pocketed groups like the UN. Nor does it have extensive experience supplying the sort of material support that towns and villages need now. Most of its prior work was focused on analysis and other projects that didn't involve delivering material goods.
"Intellectual work is still super important," Ecoaction expert Anna Danylyak said, but physical supplies are what's needed now. "It's like survival mode."
Communities that were hit even before the February invasion may in some ways be the best prepared.
Myrnohrad, the frontline town that experienced a six-month water shutoff in 2014, had long worked on reconstruction efforts with U.S. government aid agency USAID and German development agency GIZ. The city government is now seeking funding from USAID to purchase filtration systems for its wells.
In fact, the city is continuing with the complex process of making waste mine water potable even as the Russian Army continues to press its assault about an hour's drive to the northeast.
"We can't just leave the city," Tomaz said. "What will be will be. How can we give up and be afraid of Russian soldiers?"