We show that the immune response triggered by both infection and injury promotes sleep in flies and that this effect is controlled by the circadian clock. Here, CLOCK is linked to infection.