Ribosomal DNA (rDNA) loci contain hundreds of tandemly repeated copies of ribosomal RNA genes needed to support cellular viability. This repetitiveness makes it highly susceptible to copy number (CN) loss due to intrachromatid recombination between rDNA copies, threatening multigenerational maintenance of rDNA. How this threat is counteracted to avoid extinction of the lineage has remained unclear. Here, we show that the rDNA-specific retrotransposon R2 is essential for restorative rDNA CN expansion to maintain rDNA loci in the Drosophila male germline. The depletion of R2 led to defective rDNA CN maintenance, causing a decline in fecundity over generations and eventual extinction. We find that double-stranded DNA breaks created by the R2 endonuclease, a feature of R2’s rDNA-specific retrotransposition, initiate the process of rDNA CN recovery, which relies on homology-dependent repair of the DNA break at rDNA copies. This study reveals that an active retrotransposon provides an essential function for its host, contrary to transposable elements’ reputation as entirely selfish. These findings suggest that benefiting host fitness can be an effective selective advantage for transposable elements to offset their threat to the host, which may contribute to retrotransposons’ widespread success throughout taxa.