Stony corals, the engines and engineers of reef ecosystems, face unprecedented threats from anthropogenic environmental change. Corals are holobionts that comprise the cnidarian animal host and a diverse community of bacteria, archaea, viruses and eukaryotic microorganisms. Recent research shows that the bacterial microbiome has a pivotal role in coral biology. A healthy bacterial assemblage contributes to nutrient cycling and stress resilience, but pollution, overfishing and climate change can break down these symbiotic relationships, which results in disease, bleaching and, ultimately, coral death. Although progress has been made in characterizing the spatial-temporal diversity of bacteria, we are only beginning to appreciate their functional contribution. In this Review, we summarize the ecological and metabolic interactions between bacteria and other holobiont members, highlight the biotic and abiotic factors influencing the structure of bacterial communities and discuss the impact of climate change on these communities and their coral hosts. We emphasize how microbiome-based interventions can help to decipher key mechanisms underpinning coral health and promote reef resilience. Finally, we explore how recent technological developments may be harnessed to address some of the most pressing challenges in coral microbiology, providing a road map for future research in this field.