Lithium-sulfur (Li-S) battery with high theoretical capacity (1675 mAh g−1) and energy density (2600Whkg−1) is principally considered as an attractive alternative for state of art Li-ion batteries. In this study, a series of ternary composites were synthesized with bamboo-derived hierarchical carbon (BDC) to load S and flexible polyaniline (PANI) as a coating layer. The BDC/S composite was encapsulated by different weight percentage of PANI. The ternary PANI@BDC/S composites were characterized detailly by structural and electrochemical analysis and the results revealed that the PANI@BDC/S-20% electrode presented a thin and uniform PANI coating. As a cathode material for Li-S battery, the PANI@BDC/S-20% electrode exhibited the highest initial capacity (1463 mAh g−1 at 0.1C), outstanding long-life performance (366 mAh g−1 at 0.5C after 500cycles), excellent rate property (527 mAh g−1 at 2C). The incremented gains were mainly because thin PANI coating was polymerized along with the porous carbon walls of BDC substrate, leaving an excellent hierarchical porous microstructure. The specific structure showed great physical confinement for polysulfides, meantime, the polysulfide migration could be restricted by heteroatom (N atom) doped on the PANI backbone. The soft and stable PANI shell reduce volume expansion during cycles, providing an integrated conductive framework for enhancing the electrochemical contact between S particles and carbon substrate. More important, the modified polar interface contributed to stable SEI formation. Such a novel design of cathode material demonstrated great potential for practical applications in Li-S batteries.