Postmenopausal osteoporosis (PMOP) is a common primary osteoporosis. With the aging of the population, it is becoming a major disease that endangers health and quality of life. The purpose of this study was to explore the effect of gut microbiota on PMOP by observing the changes in the levels of estradiol, bone density, and gut microbiota diversity in rats after 3 months of OVX surgery. We randomly divided 60 female SD rats into four groups: baseline group (6 rats), sham-operated group (18 rats), model group (18 rats), and estrogen-treated group (18 rats). The ovariectomy model of postmenopausal osteoporosis was established by performing bilateral ovariectomy. After surgery, 6 rats from each group were randomly sacrificed every 30 days and assessed. After 90 days, all rats were sacrificed and their body weight, bone mineral density (BMD), tissue mineral density (TMD), trabecular bone parameters, femoral bone morphology, hormone levels, and gut microbiota diversity were assessed. We found that OVX led to a decrease in BMD, TMD, and serum estradiol levels in rats, and Increases TNF-α levels. The bone micro-architecture and tissue morphology were also changed, with trabecular fractures, thinning, and decreased numbers. The gut microbiota diversity also changed. Estrogen treatment could improve these changes. OVX leads to a sustained decrease in estrogen levels in rats, which results in progressive bone loss. This is associated with an imbalance in the gut microbiota.