Liu Yongfu was born on 10 October 1837 in the town of Qinzhou (Ch'in-chou, 欽州) in southern China, close to the Vietnamese border.
The fall of Nanking and the collapse of the Taiping Heavenly Kingdom in 1864 altered Liu's prospects dramatically for the worse.