Derinkuyu is large enough to have sheltered as many as 20,000 people together with their livestock and food stores. It is the largest excavated underground city in Turkey and is one of several underground complexes found throughout Cappadocia.
The city could accommodate up to 20,000 people and had amenities found in other underground complexes across Cappadocia, such as wine and oil presses, stables, cellars, storage rooms, refectories, and chapels. Unique to the Derinkuyu complex and located on the second floor is a spacious room with a barrel-vaulted ceiling. It has been reported that this room was used as a religious school and the rooms to the left were studies.
The underground city at Derinkuyu could be closed from the inside with large rolling stone doors. Each floor could be closed off separately.
During the Persian Achaemenid empire the city was used as a refugee settlement. There are references to underground refugee settlements built by the Persian king Yima in the second chapter of the Zoroastrian book Vendidad. Therefore, many scholars believe that the city may have been built by the Persians. Caves might have been built initially in the soft volcanic rock of the Cappadocia region by the Phrygians in the 8th–7th centuries BC, according to the Turkish Department of Culture.
In 1969, the site was opened to visitors, with about half of the underground city currently accessible.
According to the Wikipedia