Elemental sulfur cathodes for lithium/sulfur cells are still in the stage of intensive research due to their unsatisfactory capacity retention and cyclability. The undesired capacity degradation upon cycling originates from gradual diffusion of lithium polysulfides out of the cathode region. To prevent losses of certain intermediate soluble species and extend lifespan of cells, the effective encapsulation of sulfur plays a critical role. Here we report an applicable way, by using thin-layered nickel-based hydroxide as a feasible and effective encapsulation material. In addition to being a durable physical barrier, such hydroxide thin films can irreversibly react with lithium to generate protective layers that combine good ionic permeability and abundant functional polar/hydrophilic groups, leading to drastic improvements in cell behaviours (almost 100% coulombic efficiency and negligible capacity decay within total 500 cycles). Our present encapsulation strategy and understanding of hydroxide working mechanisms may advance progress on the development of lithium/sulfur cells for practical use.