The hexosamine biosynthetic pathway (HBP) is a nutrient-sensing metabolic pathway that produces the activated amino sugar UDP-N-acetylglucosamine, a critical substrate for protein glycosylation. Despite its biological significance, little is known about the regulation of HBP flux during nutrient limitation. Here, we report that amino acid or glucose shortage increase GFAT1 production, the first and rate-limiting enzyme of the HBP. GFAT1 is a transcriptional target of the activating transcription factor 4 (ATF4) induced by the GCN2-eIF2α signalling pathway. The increased production of GFAT1 stimulates HBP flux and results in an increase in O-linked β-N-acetylglucosamine protein modifications. Taken together, these findings demonstrate that ATF4 provides a link between nutritional stress and the HBP for the regulation of the O-GlcNAcylation-dependent cellular signalling.