The unfolded protein response (UPR) is a highly conserved pathway that allows the cell to manage endoplasmic reticulum (ER) stress that is imposed by the secretory demands associated with environmental forces. In this role, the UPR has increasingly been shown to have crucial functions in immunity and inflammation. In this Review, we discuss the importance of the UPR in the development, differentiation, function and survival of immune cells in meeting the needs of an immune response. In addition, we review current insights into how the UPR is involved in complex chronic inflammatory diseases and, through its role in immune regulation, antitumour responses.