Vermicomposting – the production of fertilizers and bioactive substrates for plants using soil oligochaetes – is an actively developing area of agricultural technology. Beneficial properties of vermicompost are provided, for the most part, by communities of bacteria that live in the digestive system of the worm and process the incoming substrate. Moreover, in light of modern trends towards biorecultivation a closest attention is paid to the ability of earthworms' microbial communities to transform organic waste from agricultural or other industries substrates into vermicompost. The aim of our study was to analyze the microbiota of the widespread soil oligochaete Eisenia fetida cultivated on commercial peat and sludge obtained from water treatment plants. Using metagenomic sequencing, we analyzed the dynamics of microbiome in digestive system of the worm during the vermicomposting. The diversity of bacteria in sludge was significantly higher than in peat. The diversity of the microbiome during vermicomposting of peat remained relatively stable compared to sewage sludge. We revealed that Eisenia fetida may absorb most of the bacteria living in the substrate in which the worms were cultivated. Most of the engulfed bacteria pass through the worm's digestive system and return to the substrate; however, part of them might be digested by the worm or remain in the gut as a functional part of its microbiome. Proteobacteria and Bacteroidetes were the dominant phyla in the earthworm gut microbial communities, regardless of the cultivation substrate. We also demonstrated the possible autochthonous microbiome of Eisenia fetida, including at least 11 genera. A stable bacterial set (including Bacillus sp., Bradyrhizobium sp., Cupriavidus sp., Cutibacterium sp., Leifsonia sp., Paeniclostridium sp., Roseomonas sp., Sphingomonas sp., Staphylococcus sp., Streptococcus sp., and Trichococcus sp.) was registered as common for the empty guts of Eisenia fetida cultivated in peat and sludge. These core bacteria may play a key role in the vermicomposting process and bioremediation, especially in such disturbed substrates as wastewater sludge, being introduced by the earthworm itself.