Liu Yongfu was born on 10 October 1837 in the town of Qinzhou (Ch'in-chou, 欽州) in southern China, close to the Vietnamese border. Qinzhou, now in Guangxi province, was at that time in the extreme southwest of Guangdong province. The ancestral home of Liu's family was the village of Popai in Guangxi province, and when he was eight his parents moved to Shangsizhou (Shang-ssu-chou, 上思州) in Guangxi. Liu's family was poor, living by manual work for others, and was only just able to scrape a living. In 1857 Liu joined a local militia force commanded by Wu Yuanqing (Wu Yuan-ch'ing, 吳元清), who claimed to hold a commission from the Taipings.