The heterogeneous base catalyst, γ-Al2O3 loaded with KOH and K (K/KOH/γ-Al2O3) was first prepared and used in the transesterification of rapeseed oil with methanol to produce biodiesel. The prepared catalyst was characterized by X-ray diffraction, scanning electron microscopy, Brunauer–Emmett–Teller method, infrared spectroscopy and X-ray photoelectron spectroscopy. It was found that when γ-Al2O3 is loaded with KOH and K, the Al–O–K species is produced, resulting in an increase in the catalytic activity. The impacts of catalyst preparation conditions on the catalytic activities of K/KOH/γ-Al2O3 were investigated. The results demonstrate that the catalyst K/KOH/γ-Al2O3 has high catalytic activity when the added amounts of KOH and K are 20 and 7.5 wt% respectively. The transesterification of rapeseed oil to biodiesel with the prepared heterogeneous base catalyst was optimized. It was found that the yield of biodiesel can reach as high as 84.52% after 1 h reaction at 60°C, with a 9:1 molar ratio of methanol to oil, a catalyst amount of 4 wt%, and a stirring rate of 270 g.