A sequential optimization strategy, based on statistical experimental designs, was used to enhance the production of riboflavin by recombinant Bacillus subtilis X42. The two-level Plackett–Burman (PB) design was implemented to screen medium components that significantly influence riboflavin production. Among the 11 variables tested, glucose, yeast powder, MgSO4•7H2O, urea, CuCl2, MnCl2 were identified as the most significant factors (confidence levels above 95%) for riboflavin production. The selected significant parameters such as yeast powder, urea and CuCl2 were further optimized using a central composite design. The optimum medium was (in g/L): yeast powder, 20.8; urea, 4.8; CuCl2, 0.024; glucose, 100; MgSO4•7H2O, 0.5; K2HPO4, 0.5; KH2PO4, 1; FeCl2, 0.02. The optimum medium led to a maximum riboflavin concentration of 7.9 g/L in shake flasks, which was 11.2% higher than the control medium.