The CsPbBr3 perovskite materials have promising applications in various optoelectronic devices due to their advantages of high luminescence color purity, tunable band gap, and high photoluminescence quantum yield. Herein, the phase stability, electronic structure, and optical properties of CsPbBr3 under rare-earth (RE) doping and hydrostatic pressure have been studied using density functional theory calculations. The relationship between properties of perovskites and different RE doping and pressure was summarized. The band gap of CsPbBr3:RE appeared reduction with the decreasing radius of the doping RE ions, which can guide the adjustment of band gap. The pressure coefficients of undoped CsPbBr3 is − 0.016 eV/GPa, while that of RE-doped CsPbBr3 exhibits an average of − 0.0144 eV/GPa. The combination of RE doping and pressure provides a wider tunable range for band gap. The rare-earth doping and applying pressure are of great significance for the regulating properties of perovskites. Our work provided the opportunities to unveil the underlying mechanism of the doping effect and pressure engineering. [ABSTRACT FROM AUTHOR]