The invention relates to a class of antibacterial cationic reactive dyes and a preparation method thereof. The dye matrix is an anthraquinone structure, the active group is a chloro-s-triazine or a fluoro-s-triazine, and the water-soluble group is a quaternary ammonium salt structure with a long carbon chain. The chemical structure is as follows: This type of dye can be used for cellulose fibers , protein fiber, polyamide fiber, acrylic fiber, cationic dyeable polyester fiber dyeing and antibacterial finishing, with high antibacterial effect, excellent color fastness, antibacterial durability. The preparation method of the dye includes: a. dissolving aminoanthraquinone A and trichloro or trifluoro-s-triazine in a nitrobenzene organic solvent, heating to 90°C, rising to 120°C after 1 hour, cooling and filtering to obtain the dye intermediate B; b. Dissolve the dye intermediate B prepared in step a in DMF organic solvent, add tertiary amine intermediate C, react at 55°C for 3-4 hours, evaporate the solvent DMF to obtain dye intermediate D, and dry it in vacuum c. Dissolve the dye intermediate D obtained in step b in DMF organic solvent, add haloalkyl E, heat to about 120°C, react for 4-5 hours, evaporate the solvent DMF, wash with ether, and recrystallize with ether-ethanol , Dye F was obtained and dried in vacuum. When this type of dye is used for textile dyeing, it can also endow textiles with certain functions, and has the advantages of water saving, energy saving, and ecological protection.