The vihara began as a practical solution to a seasonal problem: early Buddhist monks were wandering ascetics for most of the year, but the monsoon rains made travel difficult and destructive to plant life monks were enjoined not to trample, so the Buddha instituted vassa, a fixed rainy season retreat during which monks settled in one place. The simple huts and donated shelters used for this retreat gradually became permanent structures, and by the early centuries of the Common Era the vihara had developed into a standardized architectural type, cells arranged around a central courtyard, sometimes with an attached shrine room, that could house a resident community year round rather than only during the rains. As Buddhist institutions grew wealthier and more established, particularly under royal patronage in India, the largest viharas expanded into full monastic universities combining residence, teaching and extensive libraries.
Nalanda, in the eastern Indian state of Bihar, grew into one of the ancient world's great centers of learning, drawing students from across Asia to study not only Buddhist philosophy but logic, medicine and other subjects, before its decline and eventual destruction in the twelfth and thirteenth centuries amid the region's political upheavals. The place name Bihar itself derives directly from vihara, a linguistic trace of how thoroughly Buddhist monastic institutions once shaped the region.