Fermentation of Chinese herbal medicines (CHM) could enhance its bioactivities. We hypothesized probiotic-fermented GE with better potential to alleviate insomnia than thatof unfermented, thus the changes in chemical composition and the insomnia-alleviating effects and mechanisms of fermented GE on PTZ-induced insomnia zebrafish were explored via HPLC and LCMS, phenotypic, transcriptomic, and metabolomics analysis. The results demonstrated that probiotic fermented GE performed better than unfermented GE in increasing the content of chemical composition, reducing the displacement, average speed, and number of apoptotic cells in zebrafish with insomnia. Metabolomic investigation showed that the anti-insomnia effect was related to regulating the pathways of actin cytoskeleton and neuroactive ligand-receptor interactions. Transcriptomic and RT-qPCR analysis revealed that SFL significantly modulated the expression levels of neurod1, msh2, msh3, recql4, ercc5, rad5lc, and rev3l, which are mainly involved in neuron differentiation and DNA repair. Collectively, as a functional food, Fermented GE possessed potential for insomnia alleviation.