You-Gui-Yin (YGY) is a classic prescription for warming up kidney-Yang and filling in kidney essence in traditional Chinese medicine, and has been used to treat osteonecrosis of the femoral head (ONFH) effectively. However, the underlying mechanisms are still unknown. This study is aimed at exploring the possible mechanisms of action of the YGY in the treatment of ONFH based on network pharmacology and molecular docking. TCMSP was used to screen the active components and targets of YGY. The disease targets of ONFH were collected in several public databases. The protein-protein interaction (PPI) Network was constructed using the STRING platform. The Metascape database platform was used for Gene Ontology (GO) and Kyoto Encyclopedia of Genes and Genomes (KEGG) analyses. The key active components and core target proteins of YGY in the treatment of ONFH were verified by the molecular docking. 120 active components were obtained from YGY, among which 73 components were hit by the 117 drug-disease intersection targets. Key effective components included quercetin, kaempferol, beta-sitosterol, glycitein, beta-carotene, and so on. Core target proteins included ALB, AKT1, TNF, IL6, TP53, and so on. According to GO and KEGG analyses, there were 1762 biological processes, 94 cellular component, 138 molecular function and 187 signaling pathways involved. we selected the top 20 biological processes (BP), cellular components (CC), molecular functions (MF) and signaling pathways to draw the heat maps, showing that Lipid and atherosclerosis signaling pathway, IL-17 signaling pathway, HIF-1 signaling pathway, relaxin signaling pathway and MAPK signaling pathway and other pathways may play a key role in the treatment of ONFH by YGY. The results of molecular docking showed that key effective components and corresponding core target proteins exhibited the good binding activity. YGY can treat ONFH through multicomponents, multitargets, and multipathways, which provides a reference for the subsequent research, development of targeted drugs and clinical application.