Integrating metal–organic frameworks (MOFs) in microelectronics has disruptive potential because of the unique properties of these microporous crystalline materials. Suitable film deposition methods are crucial to leverage MOFs in this field. Conventional solvent-based procedures, typically adapted from powder preparation routes, are incompatible with nanofabrication because of corrosion and contamination risks. We demonstrate a chemical vapour deposition process (MOF-CVD) that enables high-quality films of ZIF-8, a prototypical MOF material, with a uniform and controlled thickness, even on high-aspect-ratio features. Furthermore, we demonstrate how MOF-CVD enables previously inaccessible routes such as lift-off patterning and depositing MOF films on fragile features. The compatibility of MOF-CVD with existing infrastructure, both in research and production facilities, will greatly facilitate MOF integration in microelectronics. MOF-CVD is the first vapour-phase deposition method for any type of microporous crystalline network solid and marks a milestone in processing such materials.