Bacillus subtilis SPB1 was shown to produce a lipopeptide biosurfactant. The insecticidal activity of this biosurfactant was evaluated against Ectomyelois ceratoniae Zeller, a moth pest of stored dates in Tunisia. The LC 50 and LC 90 values after six days of contact were 152 μg/g and 641 μg/g, respectively. To promote an economical production of this highly effective bioinsecticide, statistical experimental designs and response surface methodology were employed to optimize the concentrations of agro-industrial residues and humidity, for lipopeptide biosurfactant production by B. subtilis SPB1 under solid state fermentation. The optimal medium leading to a production yield near to 28 mg of crude lipopeptide preparation per g of wet solid material was composed of a mixture of 4.34 g of tuna fish flour and 5.66 g of potato waste flour with a moisture content of 76%.