BackgroundHeme is an iron/porphyrin complex compound, widely used in the health care, food, and pharmaceutical industries. It is more advantageous and attractive to develop microbial cell factories to produce heme by fermentation, with lower production costs and environmentally more friendly procedures than those of the traditional extraction based on animal blood. In this study,Bacillus subtilis, a typical industrial model microorganism of food safety grade, was used for the first time as the host to synthesize heme.ResultsThe heme biosynthetic pathway was engineered as four modules, the endogenous C5 pathway, the heterologous C4 pathway, the uroporphyrinogen (urogen) III synthesis pathway, and the downstream synthesis pathway. Knockout ofhemXencoding the negative effector of the concentration of HemA, overexpression ofhemAencoding glutamyl-tRNA reductase, and knockout ofrocGencoding the major glutamate dehydrogenase in the C5 pathway, resulted in an increase of 427% in heme production. Introduction of the heterologous C4 pathway showed a negligible effect on heme biosynthesis. Overexpression ofhemCDB, which encoded hydroxymethylbilane synthase, urogen III synthase, and porphobilinogen synthase participating in the urogen III synthesis pathway, increased heme production by 39%. Knockouts of uroporphyrinogen methyltransferase genenasFand both heme monooxygenase geneshmoAandhmoBin the downstream synthesis pathway increased heme production by 52%. The engineeredB. subtilisproduced 248.26 ± 6.97 mg/L of total heme with 221.83 ± 4.71 mg/L of extracellular heme during the fed-batch fermentation in 10 L fermenter.ConclusionsStrengthening endogenous C5 pathway, urogen III synthesis pathway and downstream synthesis pathway promoted the biosynthesis of heme inB. subtilis. The engineeredB. subtilisstrain has great potential as a microbial cell factory for efficient industrial heme production.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12934-023-02077-3.