In this work, multi-layer stacked two-dimensional (2D) covalent organic framework of TpPa-1 wassynthesized as nanocontainer to fabricate self-healing epoxy coating. The corrosion inhibitor ofbenzotriazole (BTA) was loaded into porous TpPa-1 (Tp: 1,3,5-Triformylphrogroglucinol, Pa-1: 1,4-phenylenediamine), and the load capacity was further improved by electrostatic adsorption. Then, 0.5 wt. % BTA/TpPa-1 and 0.5 wt.% TpPa-1 were added to the epoxy coating, respectively. The electrochemicalImpedance Spectroscopy (EIS) test shown that after 60 days of immersion, the impedance of the BTA/TpPa-1/EP in low-frequency region was 6.45108V cm2, while the impedance corresponding to theTpPa-1/EP coating was 9.04107V cm2. In addition, in the localized electrochemical impedancespectroscopy (LEIS) test, as the immersion time was extended, the impedance of TpPa-1/EP coating at thedefect continued to decrease, while the impedance at the defect of the BTA/TpPa-1/EP coating shown anupward trend, showing self-healing performance. This was due to the pH change when the metal at thedefect is corroded, which caused the BTA to be released from the nanocontainer and adhered to the metalsurface to form a protectivefilm. The improvement of the anti-corrosion performance of BTA/TpPa-1/EPcoating mainly comes from two aspects: (1) The good dispersion of TpPa-1 in EP coating improves thephysical shielding effect of the coating; (2) The controlled release of BTA can Realize the continuousformation of the bare metal surface protective layer.