Plant-endophytic microbes affect plant growth, development, nutrition, and resistance to pathogens. However, how endophytic microbial communities change in different strawberry plant compartments after Fusarium pathogen infection has remained elusive. In this study, 16S and internal transcribed spacer rRNA amplicon sequencing were used to systematically investigate changes in the bacterial and fungal diversity and composition in the endophytic compartments (roots, stems, and leaves) of healthy strawberries and strawberries with Fusarium wilt, respectively. The analysis of the diversity, structure, and composition of the bacterial and fungal communities revealed a strong effect of pathogen invasion on the endophytic communities. The bacterial and fungal community diversity was lower in the Fusarium-infected endophytic compartments than in the healthy samples. The relative abundance of certain bacterial and fungal genera also changed after Fusarium wilt infection. The relative abundance of the beneficial bacterial genera Bacillus, Bradyrhizobium, Methylophilus, Sphingobium, Lactobacillus, and Streptomyces, as well as fungal genera Acremonium, Penicillium, Talaromyces, and Trichoderma, were higher in the healthy samples than in the Fusarium wilt samples. The relative abundance of Fusarium in the infected samples was significantly higher than that in the healthy samples, consistent with the field observations and culture isolation results for strawberry wilt. Our findings provide a theoretical basis for the isolation, identification, and control of strawberry wilt disease.