The discovery of reciprocal connections between the central nervous system, sleep and the immune system has shown that sleep enhances immune defences and that afferent signals from immune cells promote sleep. One mechanism by which sleep is proposed to provide a survival advantage is in terms of supporting a neurally integrated immune system that might anticipate injury and infectious threats. However, in modern times, chronic social threats can drive the development of sleep disturbances in humans, which can contribute to the dysregulation of inflammatory and antiviral responses. In this Review, I describe our current understanding of the relationship between sleep dynamics and host defence mechanisms, with a focus on cytokine responses, the neuroendocrine and autonomic pathways that connect sleep with the immune system and the role of inflammatory peptides in the homeostatic regulation of sleep. Furthermore, I discuss the therapeutic potential of harnessing these reciprocal mechanisms of sleep-immune regulation to mitigate the risk of inflammatory and infectious diseases.