Cheng Ji was from Langzhong County (閬中縣) in Baxi Commandery (巴西郡), which is in present-day Langzhong, Sichuan.
As chaos broke out throughout China towards the end of the Eastern Han dynasty, Pang Yi wanted to improve security within Baxi Commandery, so he recruited more men to serve as soldiers.