Dalongdong — the name of a region in the northern Taipei Plain where the Danshui and Keelung Rivers meet — was likely originally a Basay indigenous settlement by the name of Pourompon (巴琅泵社). Construction on Bao'an Temple, meanwhile, began in 1804, with the arduous task undertaken in phases over the course of 25 years.
Almost 100 years prior, in 1709, the area saw its first Han Chinese settlement, as migrants from Sanyi and Tong'an in Quanzhou formed a joint-stock organization to begin clearing the land. The resultant Chen-Lai-Chang Development Company (陳賴章墾號) successfully applied to the authorities of Zhuluo County, which administered eastern Taiwan from modern-day Chiayi north. They then set to work in what are now Taipei's Wanhua, Zhongzheng, and Datong Districts and New Taipei's Xinzhuang, Sanchong, and Luzhou Districts. Not only was this company a pioneer in opening up the greater Taipei area, its work was a major milestone for Han Chinese development of the Taipei Basin.
As the Han arrivals' work expanded, the indigenous populations were gradually either Sinicized or driven out. Dalongdong became a focal point for settlement by migrants from Tong'an, with Bao'an Temple becoming the religious hub from which the surrounding streets and markets developed. The temple was rebuilt in the early 19th century, and together with the likes of the Chen Yueji Residence, the "44 Stores" street, and the Shuren Academy, it attracted a growing number of Han migrants to Dalongdong.
In 1853, in the wake of fighting between settlers from Tong'an and Sanyi in what is now Wanhua District, many of the former fled north into Dalongdong, which spurred further economic growth in the area. The "44 Stores" street, to the west of Bao'an Temple, was under construction around the same time as the temple. The street came to be lined with the 44 stores it took its name from, 22 on each side, set up by the Wang, Zheng, Gao, and Chen clans.
The buildings that lined the street were all built in the same style and roughly the same size, and at the eastern and western ends were built aimen (隘門), or gates designed as protection against potential thieves or attackers. Located at the head of the "44 Stores" street, Bao'an Temple became the center of religious life for the migrants from Tong'an in the Taipei Basin.
Entering the main hall of Bao'an Temple, one will see the main altar, which is set up for the worship of Baosheng Dadi (保生大帝). Born Wu Ben (吳本) in Tong'an, Fujian Province, he became a proficient medical practitioner, credited not only with saving innumerable human lives, but also with treating a dragon's eye and a tiger's throat, or so the legend goes. After he departed the mortal realm, he became recognized as a deity, manifesting himself through miraculous dispelling of diseases and illnesses among the faithful. In 1151, Emperor Gaozong of Song built a temple in his honor, and his successor Emperor Xiaozong canonized Wu as "Lord of the Great Dao (大道真人)."