Most MUC5B mucin polymers in the upper airways of humans and pigs are produced by submucosal glands. MUC5B forms N-terminal covalent dimers, which are further packed into larger assemblies because of low pH and high Ca2+ in the secretory granule of the mucin-producing cell. We purified the recombinant MUC5B N-terminal covalent dimer and used single-particle electron microscopy to study its structure under intracellular conditions. We found that at intragranular pH, the dimeric MUC5B organized into head-to-head noncovalent tetramers where the von Willebrand D1–D2 domains hooked into each other. These N-terminal tetramers further formed long linear complexes from which we suggest that the mucin domains and their C termini projects radially outwards. Using conventional and video microscopy, we observed that upon secretion into the submucosal gland ducts, a flow of bicarbonate-rich fluid passes the mucin-secreting cells. We suggest this unfolds and pulls out the MUC5B assemblies into long linear threads. These further assemble into thicker mucin bundles in the glandular ducts before emerging at the gland duct opening. We conclude the combination of intracellular packing of the MUC5B mucin and the submucosal gland morphology creates an efficient machine for producing linear mucin bundles.