We observed that increased serum IL-1β, IFN-γ, IL-6, IL-10, IL-12p70, IL-17, and IL-23 were significantly positively associated with an elevated risk of osteoporosis, and IL-6, IL-10, IL-12p70, IL-17, and IL-23 were positively linked to an increased risk of osteoporosis after adjusting for confounders (all P < 0.05). This evidence concerns the gene IL17A and osteoporosis.