The objective of this study is to investigate the indirect causalities between gut microbiota and sleep disorders. In stage 1, we utilized 196 gut microbiota as the exposure factor and conducted a two-sample univariable Mendelian randomization (MR) analysis on five sleep disorders: insomnia, excessive daytime sleepiness (EDS), sleep-wake rhythm disorders (SWRD), obstructive sleep apnea (OSA), and isolated REM sleep behavior disorder (iRBD). In stage 2, we validated the MR findings by comparing fecal microbiota abundance between patients and healthy controls through 16S rDNA sequencing. In stage 3, we explored the indirect pathways by which the microbiota affects sleep, using 205 gut microbiota metabolic pathways and 9 common risk factors for sleep disorders as candidate mediators in a network MR analysis. In stage 1, the univariable MR analysis identified 14 microbiota potentially influencing five different sleep disorders. In stage 2, the results from our observational study validated four of these associations. In stage 3, the network MR analysis revealed that the Negativicutes class and Selenomonadales order might worsen insomnia by increasing pain [mediation: 12.43% (95% CI: 0.47, 24.39%)]. Oxalobacter could raise EDS by disrupting adenosine reuptake [25.39% (1.84, 48.95%)]. Allisonella may elevate OSA risk via obesity promotion [36.88% (17.23, 56.54%)], while the Eubacterium xylanophilum group may lower OSA risk by decreasing smoking behavior [7.70% (0.66, 14.74%)]. Triangulation of evidence from the MR and observational study revealed indirect causal relationships between the microbiota and sleep disorders, offering fresh perspectives on how gut microbiota modulate sleep.