He was born in Houguan, Fujian, China in 1839.[1]
He passed the Provincial Exam of the Imperial examinations in 1864, and then passed the Metropolitan Exam in Beijing in 1876. He began his political career as an intern at the Hanlin Academy in Beijing for 3 years. After that, he began serving as the minister of education of Shaanxi Province, where he was just and strict to local scholars. In 1879, he became an examiner of Imperial exams in Beijing. In 1889, he became an imperial oversight advisor in Zhejiang, during which he was straightforward about his advice and strictly supervised the salary of the officials, which was praised by the public. In 1889, he became the mayor of Quzhou.[1]
In 1896, he was appointed the mayor of Hangzhou, where he fired corrupt officials, communicated with the people and banned unlawful taxation. In 1897, he founded Qiushi Academy (求是書院)[2] at the site of Puci Temple and later the Sericultural Academy (蠶學館),[3][4] which was the first higher education institute in Zhejiang. In 1899, he founded Yangzheng College (養正書塾)[5] as the province's first secondary education institute. He died in his fifth year as the mayor of Hangzhou in 1900. Hangzhou citizens buried him next to the tomb of Lin Bu in Gu Shan, where the locals called the Lin Altar (林社). Each year, local citizens came to the Altar to worship the Lins buried in the Altar. Lin Qi's friend Gao Fengqi (高鳳岐), who later served as the mayor of Wuzhou with good reputation, was also buried in the Altar by Hangzhou people.[1]