In this paper, L‐lysine (Lys), L‐glutamic acid (Glu), and L‐glutamine (Gln) ‐grafted chitosan (CS) polymers (AA‐g‐CS) are prepared by a one‐pot method, employing EDC/NHS as coupling agent. Then AA‐g‐CS glycerol phosphate hydrogels (AA‐g‐CS/GP hydrogel) are prepared by physical cross‐linking method. The prepared AA‐g‐CS/GP hydrogel has a dense 3D network structure, which facilitates the loading of drugs. The pore size and wall of hydrogels are affected by amino acid types (Lys, Glu and Gln). Berberine hydrochloride (BBH) is encapsulated in the three‐dimensional network structure of the hydrogel. Escherichia coli (Gram‐negative bacteria, E. coli) and Staphylococcus aureus (Gram‐positive bacteria, S. aureus) are selected as model bacteria, and the antibacterial properties of BBH@AA‐g‐CS/GP hydrogel are investigated by AGAR drilling method and turbidimetric method. The results show that BBH@AA‐g‐CS/GP hydrogel has a better inhibition effect on S. aureus than that on E. coli. The BBH@AA‐g‐CS/GP hydrogel can achieve long‐term inhibition of E. coli and S. aureus within 24 h. Therefore, AA‐g‐CS/GP hydrogel is an excellent carrier for BBH and is expected to be applied extensively in wound healing, tissue regeneration, and cell culture.