In this paper, an in-situ integration process of catalyst preparation and biodiesel production via ball-milling process was first proposed. The yield of biodiesel can reach 100 % in a short preparation time of 10 min and a reaction time of 20 min. According to the temperature tracking data during the reaction, there is a synergistic catalytic effect of mechanical energy and thermal energy in the reaction process. The characterization results showed the catalyst prepared by ball-milling process has excellent catalytic activity and potassium (K) is uniformly dispersed on ball-milling-K2CO3/Kraft lignin (BM-K2CO3/KL) catalysts. Based on socio-economic and techno-economic evaluation, biochar-derived catalyst for biodiesel production has created a good market value, and the mechanochemical processes are more cost-effective than traditional thermal catalytic process. This process uses ball-milling technology to integrate catalyst preparation and biodiesel production, which has the advantage of simple operation, strong controllability, and is conducive to improving the FAME yield.