The unfolded protein response (UPR) is a network of intracellular signaling pathways that maintain the protein-folding capacity of the endoplasmic reticulum (ER) in eukaryotic cells. Dedicated molecular sensors embedded in the ER membrane detect incompletely folded or unfolded proteins in the ER lumen and activate a transcriptional program that increases the abundance of the ER according to need. In metazoans the UPR additionally regulates translation and thus relieves unfolded protein load by globally reducing protein synthesis. If homeostasis in the ER cannot be reestablished, the metazoan UPR switches from the prosurvival to the apoptotic mode. The UPR involves a complex, coordinated action of many genes that is controlled by one ER-embedded sensor, Ire1, in yeasts, and three sensors, Ire1, PERK, and ATF6, in higher eukaryotes, including human. We discuss the emerging molecular understanding of the UPR and focus on the structural biology of Ire1 and PERK, the two recently crystallized UPR sensors.