Recently, more interest has been paid to the association between bone mass and gut microecological dysbiosis. The results of clinical studies comparing gut microbiota (GM) in osteoporosis patients have been inconsistent due to different inclusion and exclusion criteria. To date, the association between the GM and senile osteoporosis remains poorly understood. Here, we utilized an aged rat model (22 months old) of senile osteoporosis to study the association of the composition and function of the GM with osteoporosis by 16S rRNA and metagenomic sequencing. The results showed that there was a significant reduction in alpha diversity and the F/B (Firmicutes/Bacteroidetes) ratio in aged rats. At the genus level, the enrichment of Helicobacter was potentially related to osteoporosis as a risk factor. Metagenomics results based on two databases indicated that shifts in the GM contribute to senile osteoporosis through metabolic pathways and subsequent immune disorders. In conclusion, our study reveals the association of gut microbiota composition and function with senile osteoporosis in an aged rat model in a brand new way, and variations in the GM might contribute to senile osteoporosis through metabolic pathways.