Membrane-based approaches can offer energy-efficient and cost-effective methods for various separation processes. Practical membranes must have high permselectivity at industrially relevant high pressures and under aggressive conditions, and be manufacturable in a scalable and robust fashion. We report a versatile electrochemical directed-assembly strategy to fabricate polycrystalline metal–organic framework membranes for separation of hydrocarbons. We fabricate a series of face-centred cubic metal–organic framework membranes based on 12-connected rare-earth or zirconium hexanuclear clusters with distinct ligands. In particular, the resultant fumarate-based membranes containing contracted triangular apertures as sole entrances to the pore system enable molecular-sieving separation of propylene/propane and butane/isobutane mixtures. Prominently, increasing the feed pressure to the industrially practical value of 7 atm promoted a desired enhancement in both the total flux and separation selectivity. Process design analysis demonstrates that, for propylene/propane separation, the deployment of such face-centred cubic Zr-fumarate-based metal–organic framework membranes in a hybrid membrane–distillation system offers the potential to decrease the energy input by nearly 90% relative to a conventional single distillation process.