Strong laser pulses can control superconductivity, inducing nonequilibrium transient pairing by leveraging strong-light matter interaction. Here, we demonstrate theoretically that equilibrium ground-state phonon-mediated superconductive pairing can be affected through the vacuum fluctuating electromagnetic field in a cavity. Using the recently developed ab initio quantum electrodynamical density-functional theory approximation, we specifically investigate the phonon-mediated superconductive behavior of MgB 2 under different cavity setups and find that in the strong light–matter coupling regime its superconducting transition temperature T c can be enhanced at most by ≈ 10% in an in-plane (or out-of-plane) polarized and realistic cavity via photon vacuum fluctuations. The results highlight that strong light–matter coupling in extended systems can profoundly alter material properties in a nonperturbative way by modifying their electronic structure and phononic dispersion at the same time. Our findings indicate a pathway to the experimental realization of light-controlled superconductivity in solid-state materials at equilibrium via cavity materials engineering.