The name is Aymara. It comes from uyu, a pen or yard, with a suffix that marks ownership, so it roughly means the place with a pen. The same root gives the sense of cemetery, which is a grim coincidence given the trains left outside town.
The town was founded in 1890 as a trading post, and the railway made it. British engineers came late in the 1800s, and a sizable community of them settled in Uyuni. Construction ran from 1888 to 1892. President Aniceto Arce pushed it, convinced that good transport would help his country prosper.
Not everyone welcomed the line. Local indigenous people saw it as an intrusion on their lives, and it was constantly sabotaged. Even so, Uyuni became the point where minerals from the mines were gathered and sent on towards the Pacific ports.
Mining fell apart in the 1940s, partly because the ore was running out. Many trains were left where they stood, and they are now the train cemetery that most salt flat tours stop at. There has been talk of turning it into a museum.
Four lines meet here, coming from La Paz by way of Oruro, from Calama in Chile, from Potosí, and from Villazón on the Argentine border. Today tourism is the main source of money, with around 60,000 visitors a year.