Cooperative self-assembly of metal ions, bridging ligands and surfactants is an effective method to prepare mesostructured metal–organic frameworks (MOFs). In this study, we use quaternary ammonium surfactants with different head groups as templates to examine their effects on the structure and morphology of mesostructured MOFs formed by Cu2+ and 5-hydroxy-1,3-benzenedicarboxylic acid. In the presence of low surfactant concentrations, mesostructured MOFs with a variety of morphologies have been synthesized, having disordered, lamellar, p6mm or Pm
n structure accordingly by increasing surfactant charge density. The particle size of mesostructured MOFs can be controlled from 200 to 600 nm by adjusting the molar ratio of ligand to surfactant. Comparing our experimental results with the synthesis of mesoporous silicas, we find that they follow a similar assembly process and the charge matching between surfactant and MOF framework plays a key role in the formation of mesostructures.