The simple solution is desalinization. Won’t help Moscow or Beijing, though.
Yep, gotta be on a coast. There’s one in Southern California online now since 2015. It’s in Carlsbad which is about 30 miles north of San Diego. Largest seawater one in the USA. Cost $1 Billion and supplies about 7% of San Diego County water, 50 million gallons per day with reverse osmosis.