The gut microbiota has been shown to play an important role in the pathogenesis of various diseases, including metabolic diseases, cardiovascular diseases, and cancer. Recent studies suggest that the gut microbiota is also closely associated with bone metabolism. However, given the high diversity of the gut microbiota, the effects of different taxa and compositions on bone are poorly understood. Previous studies demonstrated that the mechanisms underlying the effects of the gut microbiota on bone mainly include its modulation of nutrient absorption, intestinal permeability, metabolites (such as short-chain amino acids), immune responses, and hormones or neurotransmitters (such as 5-hydroxytryptamine). Several studies found that external interventions, such as dietary changes, improved bone health and altered the composition of the gut microbiota. This review summarises the beneficial gut bacteria and explores how dietary, natural, and physical factors alter the diversity and composition of the gut microbiota to improve bone health, thereby providing potential new insight into the prevention of osteoporosis.