Fermenting Chinese medicinal herbs could enhance their bioactivities. We hypothesized probiotic-fermented gastrodia elata Blume (GE) with better potential to alleviate insomnia than that of unfermented, thus the changes in chemical composition and the insomnia-alleviating effects and mechanisms of fermented GE on pentylenetetrazole (PTZ)-induced insomnia zebrafish were explored via high-performance liquid chromatography (HPLC) and mass spectroscopy-coupled HPLC (HPLC-MS), 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 reverse transcription qPCR (RT-qPCR) analysis revealed that secondary fermentation liquid (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.