Eukaryotes have established symbiotic relationship with microorganisms, which enables them to accomplish functions that they cannot perform alone. In the German cockroach, Blattella germanica, the obligate endosymbiont Blattabacterium coexists with a rich gut microbiota. The transmission of Blattabacterium is vertical, but little is known about how the gut microbiota colonizes newborn individuals. In this study, we treated B. germanica populations with rifampicin, a broad-spectrum antibiotic, during two generations and analyzed gut bacterial composition and the Blattabacterium load in control and rifampicin-treated populations. Rifampicin exerted a drastic effect on gut microbiota composition, which recovered in the second generation in the case where the antibiotic was not added to the diet. Furthermore, we observed that bacterial species present in the diet, and particularly in the feces, contribute significantly to establishing the gut microbiota. Finally, the Blattabacterium population remained unaffected by the antibiotic treatment of adults during the first generation but was strongly reduced in the second generation, suggesting that this intracellular symbiont is sensitive to rifampicin only during the infection of the mature oocytes, when it is in an extracellular stage.