Under pressures of 0–30 GPa, the density functional theory was applied to investigate the structural, electronic, mechanical, optical and thermodynamic properties of cubic LiMgF3 for the first time. According to the crystal mechanical stability conditions, LiMgF3 will undergo phase transition when the pressure is greater than 31.7 GPa. According to the mechanical properties calculations, it gets harder and more ductile and anisotropic as pressure rises. The electrical calculations reveal that LiMgF3 has an indirect band gap of 5.776 eV, which grows with pressure. The optical properties show that LiMgF3 has the characteristics of low reflectivity and refractive index in the ultraviolet region, which is suitable as window material and lens material. Additionally, all spectra are blue shifted as pressure rises. By using quasi-harmonic Debye model, it is possible to anticipate how temperature and pressure would affect relative volume, bulk modulus, thermal expansion coefficient, heat capacity, and relative Debye temperature.