This study evaluated the effects of different LED spectral irradiance ratios on the growth, secondary metabolites, and essential oil characteristics of Ocimum × africanum Lour. cultivated for four weeks under controlled conditions. Four LED lighting treatments with different red, blue, green, ultraviolet-A, and far-red light ratios, and a treatment in greenhouse as low-light control were used. The constant 16 h photoperiod and light intensity of 220 µmol·m−2·s−1 were maintained. The F2 treatment (UV-A:B:R:Fr = 6.60:45.15:29.23:19.02) promoted the greatest plant height (76.62 cm), and chlorophyll a (7.41 mg/100 g, FW), chlorophyll b (4.73 mg/100 g, FW), and total phenolic (25.78 mg/g, FW) concentrations. F1 treatment (B:G:R:Fr = 17.14:29.8:47.4:5.66) produced significantly higher (p < 0.01) biomass (8.3 ton/ha, FW), oil yield (10.89 L/ha), and carotenoid (3.74 mg/100 g, FW) than the others. Essential oils contained 12–15 compounds, dominated by neral (27.5–37.3%), geranial (41.1–49.9%), and (E)-β-caryophyllene (2.4–9.9%), while the highest contents of oil (0.83%, DW), anthocyanin (16.50 mg/100 g, FW), and total flavonoid (14.17 mg/g, FW) were obtained under F4 (B:G:R:Fr = 13.85:43.50:39.30:3.35). These findings demonstrate that optimized LED spectra can effectively improve both productivity and phytochemical quality in O. africanum through regulating both primary and secondary metabolism.