Beginning with the first generation of Sufis – the time of Hasan Basri, Ibrahim Adham and Rabi`ah Adawiyyah – there are reports in the Sufi sources of the existence of zawiyahs (monastic complexes), in the secluded areas of the cities, khanaqahs (monasteries), on the fringes of urban areas, and ribats (religious-military complexes), in the frontier zones of the Islamic territory. In the days of Shaykh Abu Sa`id Abu ’l-Khayr there were khanaqahs for Sufis, in Niyshabur and Miyhanah, who considered participation in military campaigns as a part of their religious obligation, some of whom spent parts of their lives in ribats erected to defend the forward areas of the Islamic territory. At the same time, khanaqahs were built by philanthropists who intended such activities as a service to those who had opted to devote their entire lives to worship and ascetic practices, who would thus be free from having to participate in daily activities aimed at making a livelihood. These khanaqahs were mainly erected in the urban areas, close to the tombs of imams and saints. However, the construction of extensive khanaqah complexes, with personal quarters for the shaykh, and lodging facilities for the disciples and novices, as well as kitchens and other amenities, whose administration was overseen by the shaykh and his deputies, originated in the period when Sufism succeeded in establishing itself as a viable lifestyle within the Islamic community. This was a time when the followers of tariqah did their utmost to remain within the confines of shari`ah and thus to avoid any extremism. Therefore, the majority of the Sufi community had severed their ties with the advocates of sukr for their individualism, as well as with the Malamatiyyah, for their disbelief in Sufi precepts.

The vizierate of Khwajah Nizam al-Mulk witnessed a parallel development in the spread of religious schools as well as that of khanaqahs. These were modelled on schools, with hierarchies presided over by the Sufi master, where the disciples, commensurate with the length of their training and spiritual development, took on the responsibility of overseeing the novitiates. Some became the caliphs of the shaykh and were given the charge of the khanaqahs which were the offshoots of the original khanaqah built in another locality, while remaining the disciples of the founder-shaykh. Based on the personal experience and orientation of its shaykh, every khanaqah adopted its own set of rules and practices, which included those for spiritual development, such as repentance, the forty-day retreat (chillah), invocation, and other forms of worship. A particular set of rules and precepts were also enforced in all of the khanaqahs under the spiritual leadership of a founding shaykh.

Parallel to the spread of khanaqahs, there developed fraternities who had their own khanaqahs, which were mainly referred to as langar. The Malamatiyyah and, after them, the Qalandariyyah, Jawlaqiyyah, Jalali and Khaksari dervishes as well as other itinerants had established their own khanaqahs, a development that at times resulted in the deprecation of otherwise reputable Sufi masters. Sufi impostors, usually referred to as mutisawwif or mustaswif, were the prime cause of this unfortunate state of affairs. These were a bunch who feigned tasawwuf by donning the attire of Sufis and exhibiting their outward practices without a trace of genuine spirituality.

Sa`di’s remark in his Gulistan is an apt depiction of the deteriorating state of the Sufism of his era: “In the past they were a group ostensibly scattered but truly together, whereas today they are a group ostensibly together but truly scattered.” The mystical writings of the later generations continued to bemoan the plague of these impostors. In his Mathnawi, Mawlana lashes out against the Sufis of his day. This is commonplace in the mystical works of various eras, from those of Ghazzali, Qushayri and Hujwiri, to al-Luma` and Sharh ta`arruf, the oldest handbook on Sufism.