It is estimated that only 0.02% of disseminated tumour cells are able to seed overt metastases1. While this suggests the presence of environmental constraints to metastatic seeding, the landscape of host factors controlling this process remains largely unclear. Here, combining transposon technology2 and fluorescence niche labelling3, we developed an in vivo CRISPR activation screen to systematically investigate the interactions between hepatocytes and metastatic cells. We identify plexin B2 as a critical host-derived regulator of liver colonization in colorectal and pancreatic cancer and melanoma syngeneic mouse models. We dissect a mechanism through which plexin B2 interacts with class IV semaphorins on tumour cells, leading to KLF4 upregulation and thereby promoting the acquisition of epithelial traits. Our results highlight the essential role of signals from the liver parenchyma for the seeding of disseminated tumour cells before the establishment of a growth-promoting niche. Our findings further suggest that epithelialization is required for the adaptation of CRC metastases to their new tissue environment. Blocking the plexin-B2–semaphorin axis abolishes metastatic colonization of the liver and therefore represents a therapeutic strategy for the prevention of hepatic metastases. Finally, our screening approach, which evaluates host-derived extrinsic signals rather than tumour-intrinsic factors for their ability to promote metastatic seeding, is broadly applicable and lays a framework for the screening of environmental constraints to metastasis in other organs and cancer types.