Beta-barrel membrane proteins are essential for nutrient import, signalling, motility and survival. In Gram-negative bacteria, the beta-barrel assembly machinery (BAM) complex is responsible for the biogenesis of beta-barrel membrane proteins, with homologous complexes found in mitochondria and chloroplasts. Here we describe the structure of BamA, the central and essential component of the BAM complex, from two species of bacteria: Neisseria gonorrhoeae and Haemophilus ducreyi. BamA consists of a large periplasmic domain attached to a 16-strand transmembrane beta-barrel domain. Three structural features shed light on the mechanism by which BamA catalyses beta-barrel assembly. First, the interior cavity is accessible in one BamA structure and conformationally closed in the other. Second, an exterior rim of the beta-barrel has a distinctly narrowed hydrophobic surface, locally destabilizing the outer membrane. And third, the beta-barrel can undergo lateral opening, suggesting a route from the interior cavity in BamA into the outer membrane.