Bacterial nanocellulose (BNC) is a promising material for oily wastewater separation due to its hydrophilic and nanometer-scale porous structure. However, its application is constrained by high production costs. This study explores the utilization of underutilized Flammulina filiformis spent mushroom substrate (Ff-SMS) to produce BNC cost-effectively. Ff-SMS was pretreated with dilute sulfuric acid and cellulase to obtain hydrolysate and lignin residue. The hydrolysate was fermented using bacteria strains LDU-K and LDU-A to produce BNC. The lignin residue was modified to enhance hydrophilicity and cross-linked with BNC to create lignin-bacterial nanocellulose (LIG-BNC) composites for oil/water separation. The yields of BNC from white and yellow F. filiformis hydrolysates were increased significantly than from the nitrogen-free glucose synthesis medium. LIG-BNC demonstrated improved hydrophilicity and porosity, with water fluxes of 19,316 ± 170 L m