Osteoporosis is a common metabolic bone disease that affects about 40% of postmenopausal women. Treatment options for osteoporosis are limited, however. Icariin is an herbal substance that has been shown to improve bone mass, but the mechanisms are largely unknown. Using bioinformatics analysis, we have identified the hub genes and KEGG pathways shared between icariin-targeted genes and osteoporosis. The top five shared KEGG pathways were the Toll-like receptor signaling pathway, adipocytokine pathway, neurotrophin signaling pathway, NOD-like receptor signaling, and B cell receptor signaling pathway; the hub genes were RELA, NFKBIA, and IKBKB, belonging to the NF-κB family. The identified icariin-targeted genes are involved in inflammation, insulin resistance, apoptosis, and immune responses, and regulate the PI3K-Akt, NF-κB, MAPK, and JNK signaling pathways. Our in vitro data show that icariin inhibits apoptosis in human mesenchymal stem cells by suppressing JNK/c-Jun signaling pathway. Together, these findings indicate that icariin exerts its anti-osteoporotic function by inhibiting JNK/c-Jun signaling pathway, and suggest that icariin may be a promising treatment option for osteoporosis.