We assessed the biodiesel production process in a continuous microchannel through preparation of a heterogeneous catalyst (CaO/MgO) from demineralized water plant sediment. This mixed oxide catalyst was used for transesterification of rapeseed oil as feedstock by methanol to produce biodiesel fuel at various conditions. A microchannel, utilized as a novel reactor, was applied to convert rapeseed oil into biodiesel in multiple steps. The effects of the process variables, such as catalyst concentration, methanol to oil volume ratio, n-hexane to oil volume ratio, and reaction temperature on the purity of biodiesel, were carefully investigated. Box-Behnken experimental design was employed to obtain the maximum purity of biodiesel response surface methodology. The optimum condition for the production of biodiesel was the following: catalyst concentration of 7.875 wt%, methanol to oil volume ratio of 1.75 : 3, n-hexane to oil volume ratio of 0.575 : 1, and reaction temperature of 70 oC.