The invention discloses a kind of rare earth doped near-infrared luminescent glass and a preparation method thereof. The luminescent glass is composed of the following components in mole ratio: 45 parts of SiO2, 10 parts of Al2O3, 15 parts of Na2O, 30 parts of ZnF2, and 0.5 part of RE2O3 or 45 parts of SiO2, a parts of Al2O3, b parts of MO, 30 parts of MF2, and 0.5 part of RE2O3, wherein a refers to the mole fraction of Al2O3, b refers to the mole fraction of MO, a+b=25, a is greater than or equal to 6 and less than or equal to 15, b is greater than or equal to 10 and less than or equal to 19, MO refers to alkaline earth metal oxide, MF2 refers to alkaline earth metal fluoride, and RE2O3 refers to rare earth oxide. The glass disclosed by the invention is prepared by using a molten cooling method, and selected raw materials are non-toxic, environment-friendly, and low in cost; the rare earth doped glass can emit near-infrared light at multiple wave bands, and in the process of emitting, two-step even three-step continuous near-infrared radiation exists; the luminescent quantum efficiency is expected to be greater than 100%. The glass can be used for preparing near infrared optical fiber materials.