The spread of SARS-CoV-2 and ongoing COVID-19 pandemic underscores the need for new treatments. Here we report that cannabidiol (CBD) inhibits infection of SARS-CoV-2 in cells and mice. CBD and its metabolite 7-OH-CBD, but not THC or other congeneric cannabinoids tested, potently block SARS-CoV-2 replication in lung epithelial cells. CBD acts after viral entry, inhibiting viral gene expression and reversing many effects of SARS-CoV-2 on host gene transcription. CBD inhibits SARS-CoV-2 replication in part by up-regulating the host IRE1 RNase endoplasmic reticulum (ER) stress response and interferon signaling pathways. In matched groups of human patients from the National COVID Cohort Collaborative, CBD (100 mg/ml oral solution per medical records) had a significant negative association with positive SARS-CoV-2 tests. This study highlights CBD as a potential preventative agent for early-stage SARS-CoV-2 infection and merits future clinical trials. We caution against use of non-medical formulations including edibles, inhalants or topicals as a preventative or treatment therapy at the present time.