$β$-glucan is a prebiotic well known for its beneficial outcomes on sea cucumber health through modifying the host intestinal microbiota. High-throughput sequencing techniques provide an opportunity for the identification and characterization of microbes. In this study, we investigated the intestinal microbial community composition, interaction among species, and intestinal immune genes in sea cucumber fed with diet supplemented with or without $β$-glucan supplementation. The results show that the intestinal dominant classes in the control group are Flavobacteriia, Gammaproteobacteria, and Alphaproteobacteria, whereas Alphaproteobacteria, Flavobacteriia, and Verrucomicrobiae are enriched in the $β$-glucan group. Dietary $β$-glucan supplementation promoted the proliferation of the family Rhodobacteraceae of the Alphaproteobacteria class and the family Verrucomicrobiaceae of the Verrucomicrobiae class and reduced the relative abundance of the family Flavobacteriaceae of Flavobacteria class. The ecological network analysis suggests that dietary $β$-glucan supplementation can alter the network interactions among different microbial functional groups by changing the microbial community composition and topological roles of the OTUs in the ecological network. Dietary $β$-glucan supplementation has a positive impact on immune responses of the intestine of sea cucumber by activating NF-$ąppa$B signaling pathway, probably through modulating the balance of intestinal microbiota.