Various strains of bacteria are able to produce a unique class of functional amyloids termed curli, which are critical for biofilm formation, host cell adhesion, and colonization of inert surfaces. Curli are secreted via the type VIII bacterial secretion system, and they share biochemical and structural characteristics with amyloid fibers that have been implicated in deleterious disease in humans. Here, we report the crystal structure of Escherichia coli CsgG, which is an essential lipoprotein component of the type VIII secretion system and which forms a secretion channel in the bacterial outer membrane for transporting curli subunits. CsgG forms a crown-shaped, symmetric nonameric channel that spans the outer membrane via a 36-strand β-barrel, with each subunit contributing four β-strands. This nonameric complex contains a central channel with a pore located at the middle. The eyelet of the pore is ∼12 Å in diameter and is lined with three stacked nine-residue rings consisting of Tyr-66, Asn-70, or Phe-71. Our structure-based functional studies suggest that Tyr-66 and Phe-71 residues function as gatekeepers for the selective secretion of curli subunits. Our study describes in detail, to our knowledge, the first core structure of the type VIII bacterial secretion machinery. Importantly, our structural analysis suggests that the curli subunits are secreted via CsgG across the bacterial outer membrane in an unfolded form.CsgG | curli | amyloids | outer membrane protein | biofilm