People have lived on this coast for a very long time. A site in the Akhshtyr cave near Adler is 40,000 to 50,000 years old. Around 2000 BC people built stone dolmens here, and at least fifty of them still stand. Greek ships called here from the 6th or 5th century BC. The north wall of an 11th-century basilica is still up in Loo.
Before the Russians came, this was the land of the Abkhaz, Ubykh and Adyghe (Circassian) peoples. Their languages gave the city its name, which roughly means seaside. The Ottomans lost the coast to Russia in 1829, and in April 1838 Russian troops laid the first stone of a fort at the mouth of the Sochi river.
The war ended in 1864, announced at Qbaada, the place now called Krasnaya Polyana. What followed was a mass expulsion. Most Circassians were killed or sent away, mainly to the Ottoman Empire, and Sochi was one of the ports where ships took them. Estimates from Russian archive figures put the loss at 80 to 97 percent of the Circassian population. The Russian government then invited settlers from across the empire, and a village grew on the shore. It took the name Sochi in 1896 and town status in 1917. The Archangel Column, put up in 2006, honours the Russian soldiers of that war.
Settlers tried to grow tea in the 1870s and 1880s and failed in the cold. Koshman's seeds from Adjara worked in 1901, and the first successful plantation dates to 1905. The first bath building at the Matsesta springs went up in 1902. There was one big obstacle: malaria. The swamps were so bad that people doubted a resort could exist here at all. Crews drained them, planted eucalyptus to soak up water, and in 1925 introduced a small fish that eats mosquito larvae. The disease was gone by 1956, and Adler has a monument to the fish.
Stalin's government began rebuilding Sochi in 1934, and between 1932 and 1939 the population jumped from 17,000 to 72,000. By 1940 there were more than 60 sanatoriums and hospitals, against six in the late 1920s. The train station, seaport, Winter Theatre and Art Museum all date from that push. Stalin had his favourite dacha built here. In the war the whole city became a hospital: about 500,000 wounded soldiers recovered in 111 hospitals.
In 1961 the authorities merged Sochi with Adler and Lazarevskoye, which is why a single city now runs for 105 km. By the 1980s the resort took 5 million visitors a year, including 200,000 foreigners. Then the Union collapsed and the numbers fell to 300,000 in the 1990s. They had climbed back to 1.5 million by 2000. Presidents kept the habit of holidaying here; Bocharov Ruchey near Dagomys, built for Voroshilov, became a presidential residence.
In July 2007 Sochi beat Pyeongchang and Salzburg to host the 2014 Winter Games. The choice was a paradox, since Russians think of this as the palm-tree city. The budget began at US$12 billion and grew to US$51 billion, which made these the most expensive Olympics ever. The money rebuilt roads and left sports venues and new housing. Sochi also staged matches of the 2018 World Cup.