Wudoumi dao 五斗米道 "Way of Five Pecks of Grain" was the oldest movement of religious Daoism that can be called a "school" or "sect". It was founded by Zhang Ling 張陵 (34-156 CE). Zhang came from eastern China, but moved into Sichuan (at that time called Shu 蜀), where he lived in the vales of Mt. Heming 鶴鳴山 (near Dayi 大邑, close to Chengdu 成都) and cultivated the Dao "Way". He is said to have written talismans and charms which he distributed among the population. According to legend, Zhang was instructed by an immoral descending from Heaven. As a healer of diseases, Zhang was able to attract numerous disciples who learned from Zhang the use of 24 so-called "treatment spots" (zhi 治). Each of his disciples and followers paid a "tuition fee" of 5 pecks (dou 斗, see weights and measures) of grain. This custom later gave the school its name. The healing methods of Zhang were influenced by shamanic methods of the local population. He was therefore called the "grain shaman" (miwu 米巫).
After Zhang Ling's death, his son Zhang Heng 張衡 (78-139 CE) took over the lead of the school, and then Zhang Lu 張魯 (d. 216 CE), a son of Zhang Heng. The three Zhangs (San Zhang 三張) were also called the "three teachers" (sanshi 三師). Zhang Ling was the "Celestial Master" (tianshi 天師), Zhang Heng the "Master by Inheritance" (sishi 嗣師), and Zhang Lu the "Master of the Lineage" (xishi 系師). The school was therefore also later called School of the Celestial Masters (Tianshi dao 天師道).
Of Zhang Heng's life, nothing is known, but there is a biography of Zhang Lu in the official history Sanguozhi 三國志. Zhang Lu is the historically most important person of the three. He served as a military official (duyi sima 督義司馬) of governor Liu Yan 劉焉 (d. 194) at the end of the 2nd century CE. When war broke out between the warlords controlling the provinces of the Later Han dynasty 後漢 (25-220), Zhang Lu assembled his followers, united them with Zhang Xiu 張修 (d. 200 CE), another military commander, and conquered the region of Hanzhong 漢中 (a mountainous region located between the provinces Shaanxi and Sichuan). Liu Zhang 劉璋 (162-220), a son of Liu Yan, killed Zhang Lu's mother. This incident gave him the idea to proclaim his own, independent state in the Hanzhong region. He was even officially appointed general appeasing the south (zhennan zhonglang jiang 鎮南中郎將).
Politically, Zhang Lu was virtually independent and used this position to realize a Daoist society. He appointed his own officials all of which were also his religious followers. New adepts flocking to his state were called guizu 鬼卒 "ghost troops", and older followers were granted the title of jijiu 祭酒 "libationer". Zhang Lu called himself "Lord Teacher" (shijun 師君). The population was cared for in a system of granaries (yishe 義舍, see also yicang 義倉) providing them with grain and other food.
Even if Zhang Lu was the head of a secular government, the healing practice, which was an important element of his religion, was not abandoned. Zhang had established healing temples, so-called "halls of silence" (jingshi 靜室), where healer officials, so-called "ghost scribes" (guili 鬼吏), prayed for the health of the patients. During this ceremony, the name of the patient was written on paper, along with the sins he was believed to have committed and which were thought to be the reason for the disease. Three papers were written; one was burnt in order to ascend to Heaven, one was buried, and one was immerged in water.
Zhang Lu had invented the oldest ceremonial session of Daoism, the mud-and-soot retreat (tutanzhai 涂炭齋). By this ritual, a sick person would beg for pardon for his sins.
Zhang Lu preached the book Laozi 老子 (Daodejing 道德經) and wrote a commentary on it, the so-called Laozi Xiang'er zhu 老子想爾注, in which he explained the text of the Daodejing, often seen as a philosophical book, from a religious viewpoint. The dao 道 "Way" was interpreted as a principle which would bring health and long life, if an adept was able to find and keep to it. The dao controlled all beings on earth, including spirits and deities. Laozi, with the religious name Taishang Laojun 太上老君 "Old Lord on High", was the personification of the "Way". A man had to preserve unity with the Way and to keep distance to all things not belonging to it. Keeping the rules of the dao by carrying out morally good deeds would bring success; and assembling a pure spirit would result in a spiritualization bringing immortality. These were the so-called "jewels of the self" (shen bao 身寳).
The religious practice of the Five-Pecks-of-Grain School was thus characterized by talismans (fulu 符籙), incantations (zhoushu 咒術), praying before an altar (qixiang zhaijiao 祈禳齋醮), but also by the "preservation of completeness" (shouyi 守一), circulating the breath (xingqi 行氣) and the art of the bedchamber (fangzhongshu 房中術). The Daoist adept was forbidden to eat grain, and instead devoured "breath" (qi 氣). Yin and Yang were to be unified to produce spirits (jing 精), the concentration of sprits would result in a higher form of being (shen 神), i. e. immortality, or at least, self-preservation (zishou 自守).
In 215 CE, the powerful warlord of the north, Cao Cao 曹操, conquered the Hanzhong region, and Zhang Lu's state vanished. Yet the religious activities continued to prosper in this region, and a new movement emerged at the end of the third century CE, under the guidance of Chen Rui 陳瑞. This was the Way of the Celestial Master (tianshi dao 道天師).