With the increasing severity of metal corrosion damage, preparing coatings with long-term anticorrosion properties is attracting more attention. Herein, halloysite nanotubes (HNT) encapsulated by chitosan (CS) with pH-responsive release of corrosion inhibitors (BTA) are prepared, which is denoted as HNT-CS@BTA and employed to promote the long-term anticorrosion properties of epoxy coating. The BTA release curve illustrates that the BTA can be released in an acidic environment. From the electrochemical results, the low-frequency impedance modulus of the coating with 1 wt% HNT-CS@BTA still reaches 1.47 × 109 Ω·cm2 after 42 days, exhibiting a significantly higher value than the pure epoxy coating of 9.26 × 105 Ω·cm2. The uniaxial tensile test shows that the coating added 1 wt% HNT-CS@BTA results in a significantly enhanced tensile strength of 3.90 MPa, surpassing that of the pure epoxy coating by more than twofold. The results of the scanning Kelvin probe show that the coating with 1 wt% HNT-CS@BTA has a higher potential at the scratched area, proving the self-healing properties. The results demonstrate that halloysite nanotubes can serve as nanocontainers to endow the coating with self-healing properties and promote the mechanical and long-term anticorrosion properties of epoxy coatings.