Metastases arise from rare cancer cells that successfully adapt to the diverse microenvironments encountered during dissemination through the bloodstream and colonization of distant tissues. How cancer cells acquire the ability to appropriately respond to microenvironmental stimuli remains largely unexplored. Here, we report an epigenetic pliancy mechanism that allows cancer cells to successfully metastasize. We find that a decline in the activity of the transcriptional repressor ZBTB18 defines metastasis-competent cancer cells in mouse models. Restoration of ZBTB18 activity reduces chromatin accessibility at the promoters of genes that drive metastasis, such as Tgfbr2, and this prevents TGFβ1 pathway activation and consequently reduces cell migration and invasion. Besides repressing the expression of metastatic genes, ZBTB18 also induces widespread chromatin closing, a global epigenetic adaptation previously linked to reduced phenotypic flexibility. Thus, ZBTB18 is a potent chromatin regulator, and the loss of its activity enhances chromatin accessibility and transcriptional adaptations that promote the phenotypic changes required for metastasis.