Abstract Directed cell migration is driven by the front–back polarization of intracellular signalling 1–3 . Receptor tyrosine kinases and other inputs activate local signals that trigger membrane protrusions at the front 2,4–6 . Equally important is a long-range inhibitory mechanism that suppresses signalling at the back to prevent the formation of multiple fronts 7–9 . However, the identity of this mechanism is unknown. Here we report that endoplasmic reticulum–plasma membrane (ER–PM) contact sites are polarized in single and collectively migrating cells. The increased density of these ER–PM contacts at the back provides the ER-resident PTP1B phosphatase more access to PM substrates, which confines receptor signalling to the front and directs cell migration. Polarization of the ER–PM contacts is due to microtubule-regulated polarization of the ER, with more RTN4-rich curved ER at the front and more CLIMP63-rich flattened ER at the back. The resulting ER curvature gradient leads to small and unstable ER–PM contacts only at the front. These contacts flow backwards and grow to large and stable contacts at the back to form the front–back ER–PM contact gradient. Together, our study suggests that the structural polarity mediated by ER–PM contact gradients polarizes cell signalling, directs cell migration and prolongs cell migration.