Objectives: This study aimed to predict the mechanism underlying the effects of buguzhi (補骨脂) on vitiligo through network pharmacology analysis and molecular docking.Methods: The active compounds of buguzhi and its related genes were collected through traditional chinese bank (TCM Bank) and encyclopedia of traditional chinese medicine (ETCM) databases. Vitiligo-related genes were collected using Comparative Toxicogenomics Database (CTD), DisGenet, and Gene Cards. The overlapping genes between buguzhi-related genes and vitiligo-related genes were designated target genes. Protein-protein interaction analysis was performed using the STRING for target genes. The top 10 genes and top 3 compounds with high association in the target gene networks were selected as hub genes and compounds using CytoHubba. Functional enrichment analysis was conducted using an the science and research online plot, categorized by biological process (BP), cellular component (CC), and molecular function (MF). Molecular docking was performed using AutoDockTools.Results: Fifty-six target genes were collected. Three hub compounds (uvadex, psoralen, and stearic acid) and 10 hub genes (<i>TP53</i>, <i>BCL2</i>, <i>IL1B</i>, <i>TNF</i>, <i>NFKB1</i>, <i>CASP3</i>, <i>ACTB</i>, <i>INS</i>, <i>FOS</i>, <i>and PTGS2</i>) were revealed. The top-ranked hub gene was TP53. Functional enrichment revealed that the hub genes with the highest enrichment scores in the biological process were those that regulate reactive oxygen species metabolism, nuclear membrane in the cellular component, and tumor necrosis factor superfamily binding and cytokine receptor binding in the molecular function. Psoralen and uvadex stably interacted with tumor protein p53 (TP53) with affinity energies of −4.7 and −4.867 kcal/mol.Conclusions: Buguzhi is predicted to treat vitiligo by regulating p53 to scavenge reactive oxygen species and protect melanocytes from various immune responses induced by oxidative stress, promoting melanogenesis.