The multidrug efflux pumps of Gram-negative bacteria are a class of complexes that span the periplasm, coupling both the inner and outer membranes to expel toxic molecules. The best-characterized example of these tripartite pumps is the AcrAB-TolC complex of Escherichia coli. However, how the complex interacts with the peptidoglycan (PG) cell wall, which is anchored to the outer membrane (OM) by Braun’s lipoprotein (Lpp), is still largely unknown. In this work, we present molecular dynamics simulations of a complete, atomistic model of the AcrAB-TolC complex with the inner membrane, OM, and PG layers all present. We find that the PG localizes to the junction of AcrA and TolC, in agreement with recent cryo-tomography data. Free-energy calculations reveal that the positioning of PG is determined by the length and conformation of multiple Lpp copies anchoring it to the OM. The distance between the PG and OM measured in cryo-electron microscopy images of wild-type E. coli also agrees with the simulation-derived spacing. Sequence analysis of AcrA suggests a conserved role for interactions with PG in the assembly and stabilization of efflux pumps, one that may extend to other trans-envelope complexes as well.