The UV contained in sunlight can suppress the immune system, which makes UV a powerful carcinogen. At the same time, beneficial health effects of sun exposure are increasingly being recognised, including protection against some inflammatory diseases. To receive health benefits from sunlight without being exposed to its harmful effects, we must determine how much UV is sufficient to suppress immunity without damaging DNA. Questions about expanding the role of artificial UV and phototherapy in generating beneficial immunomodulatory effects have also emerged. Understanding how cells and molecules in the skin respond to UV and how these interactions shape immunological activity is essential for addressing the complex problem of balancing the harms and benefits of sun exposure for human health.