Purpose We examined the effects of vermicompost application as a basal fertilizer on the properties of a sandy loam soil used for growing cucumbers under continuous cropping conditions when compared to inorganic or organic fertilizers. Materials and methods A commercial cucumber (Cucumis sativus L.) variety was grown on sandy loam soil under four soil amendment conditions: inorganic compound fertilizer (750 kg/ha,), replacement of 150 kg/ha of inorganic compound fertilizer with 3000 kg/ha of organic fertilizer or vermicompost, and untreated control. Experiments were conducted in a greenhouse for 4 years, and continuous planting resulted in seven cucumber crops. The yield and quality of cucumber fruits, basic physical and chemical properties of soil, soil nutrient characteristics, and the soil fungal community structure were measured and evaluated. Results and discussion Continuous cucumber cropping decreased soil pH and increased electrical conductivity. However, application of vermicompost significantly improved several soil characteristics and induced a significant change in the rhizosphere soil fungal community compared to the other treatments. Notably, the vermicompost amendments resulted in an increase in the relative abundance of Ascomycota, Chytridiomycota, Sordariomycetes, Eurotiomycetes, and Saccharomycetes, and a decrease in Glomeromycota, Zygomycota, Dothideomycetes, Agaricomycetes, and Incertae sedis. Compared to the organic fertilizer treatment, vermicompost amendment increased the relative abundance of beneficial fungi and decreased those of pathogenic fungi. Cucumber fruit yield decreased yearly under continuous cropping conditions, but both inorganic and organic fertilizer amendments increased yields. Vermicompost amendment maintained higher fruit yield and quality under continuous cropping conditions. Conclusions Continuous cropping decreased cucumber yield in a greenhouse, but basic fertilizer amendment reduced this decline. Moreover, basal fertilizer amendment decreased beneficial and pathogenic fungi, and the use of vermicompost amendment in the basic fertilizer had a positive effect on the health of the soil fungal community.