Before the city there was Mzizima, a fishing village on the edge of Indian Ocean trade routes. In the 1860s the Zanzibar ruler Sultan Majid started a new town next to it. He called it Dar es Salaam. His Old Boma, put up in 1866 and 1867, is among the oldest buildings you can still see.
The town faded after Majid died in 1870. A German trading company opened a station in 1887 and brought it back to life. The Central Railway of the early 1900s fed its growth. The Lutheran Azania Front church and St Joseph's Cathedral, both from around 1900, still stand.
British forces took the city in 1916 during the First World War. German authorities surrendered on 3 September. The British ran the city as separate quarters: Europeans in Oyster Bay, Africans in Kariakoo and Ilala, and many workers from British India too. The Askari Monument remembers the Askari soldiers of that war.
Tanganyika became independent in December 1961, with Dar es Salaam as its capital, and it stayed the capital after the 1964 union with Zanzibar formed Tanzania. In 1967 the government declared ujamaa, a socialist policy that discouraged people from moving to cities. The capital moved to Dodoma on paper, but most government offices stayed here.
The numbers show the pace. About 20,000 people lived here in 1900, 93,000 in 1957 and 4,364,541 at the 2012 census. Today it is more than 7 million. Until the late 1990s it ranked below Nairobi and Johannesburg. The port now handles trade for landlocked Rwanda, Burundi, Zambia and eastern Congo.
That growth has outrun the city's services. More than three-quarters of residents live in informal settlements, and the transport system is outdated, with occasional power rationing. The 2022 IPCC report also lists Dar among 12 African cities most exposed to rising seas.