In the present work, biodiesel production from the transesterification of the cottonseed oil with ethanol over a novel CaO–MgO/Al2O3 catalyst has been studied, and the effects of experimental factors such as loading of CaO–MgO on Al2O3, reaction temperature and molar ratio of ethanol to cottonseed oil on the oil conversion were investigated. CaO–MgO/Al2O3 catalysts were prepared via a conventional coprecipitation method. These catalysts were characterized by X-ray diffraction (XRD), scanning electron microscopy (SEM) and temperature-programmed desorption of CO2 (TPD-CO2). The operational conditions on the cottonseed oil conversion were investigated using Design of Experiment (DOE). The optimized conditions predicted by Box–Behnken design were found to be 14.4 wt% loading of CaO–MgO on Al2O3, with molar ratio of ethanol to cottonseed oil = 12.24 and reaction temperature = 95.63 8C in order to achieve a conversion of 97.62%. The predicted results agree with the experimental results (12.5 wt% loading of CaO–MgO on Al2O3, molar ratio of ethanol to cottonseed oil = 8.5 and reaction temperature of 95 8C with 92.45% conversion).