Chaperones increase the folding yields of soluble proteins by suppressing misfolding and aggregation, but how they modulate the folding of integral membrane proteins is not well understood. Here we use single-molecule force spectroscopy and NMR spectroscopy to observe the periplasmic holdase chaperones SurA and Skp shaping the folding trajectory of the large β-barrel outer-membrane receptor FhuA from Escherichia coli. Either chaperone prevents FhuA from misfolding by stabilizing a dynamic, unfolded state, thus allowing the substrate to search for structural intermediates. During this search, the SurA-chaperoned FhuA polypeptide inserts β-hairpins into the membrane in a stepwise manner until the β-barrel is folded. The membrane acts as a free-energy sink for β-hairpin insertion and physically separates transient folds from chaperones. This stabilization of dynamic unfolded states and the trapping of folding intermediates funnel the FhuA polypeptide toward the native conformation.