A cave or grotto (kandara, guhà or leõa) is a large cavity in the side of a cliff or under the ground. Ascetics and hermits of all religious traditions have long been attracted to caves. This is because they are usually in remote places and because they muffle sound, thus offering both solitude and silence. Caves are one of the five types of habitation the Buddha mentioned as being suitable for monks (Vin.V,146). Some of the caves around Ràjagaha mentioned as being popular with monks and nuns were the Indasàla Cave (D.II,263), the Kapota Cave (Ud.39), the Pipphali Cave (Ud.4), the  Såkarakhata Cave (M.I,497) and Sattapaõõi Cave (Vin.II,76). This last cave was the venue of the first Buddhist council. When suitable caves were not available monks would sometimes arrange to have small caves enlarged or even have artificial ones excavated out of rocky mountainsides (Vin.III,248).

In later centuries Indian Buddhists developed sophisticated technologies for excavating caves so they could be used as monasteries. Amongst the earliest of these are the Bhaja, Bedsa and Karla Caves near Pune, each of which has assembly halls, storerooms, kitchens, cisterns and monks' cells, all carved out of the living rock. The largest and most elaborate of India's cave monasteries are at Ajanta and Ellora. The 30 caves at Ajanta were excavated between the 1st century BCE and the 5th century CE and are elaborately decorated with sculpture and paintings.