Trivalent rare earth erbium ion (Er<sup>3+</sup>) doped titanium oxide (TiO<sub>2</sub>) can possess a very wide range of applications due to its excellent optoelectronic properties, thus standing out among many rare-earth-doped luminescent crystals. However, the issues regarding local structure and electronic properties have not been finalized. To address these problems, the CALYPSO (Crystal structure AnaLYsis by Particle Swarm Optimization) method combined with the first-principles calculations is employed, and many converged structures of Er<sup>3+</sup>-doped TiO<sub>2</sub> are successfully obtained. Further structural optimization is performed by using the VASP (Vienna <i>ab initio</i> simulation package) software package, and we report for the first time that the lowest energy structure of Er<sup>3+</sup>-doped TiO<sub>2</sub> has the <inline-formula><tex-math id="M2">\begin{document}$ P\overline 4 $\end{document}</tex-math><alternatives><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="24-20221847_M2.jpg"/><graphic xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="24-20221847_M2.png"/></alternatives></inline-formula><i>m</i>2 symmetry. It can be observed that the doped Er<sup>3+</sup> ions enter into the host crystal and occupy the positions of Ti<sup>4+</sup> ions, resulting in structural distortion, which eventually leads the local Er<sup>3+</sup> coordination site symmetry to reduce from <i>D</i><sub>2<i>d</i></sub> into <i>C</i><sub>2<i>v</i></sub>. We speculate that there are two reasons: 1) the difference in charge between Er<sup>3+</sup> ions and Ti<sup>4+</sup> ions leads to charge compensation; 2) the difference between their electron radii is obvious: the radius is 0.0881 for Er<sup>3+</sup> ion and 0.0881 for Ti<sup>4+</sup> ion. In addition, during the structural search, we also find many metastable structures that may exist at a special temperature or pressure, which play an important role in the studying of structural evolution. When the electronic band structure of the Er<sup>3+</sup>-doped TiO<sub>2</sub> system is calculated, we adopt the method of local density approximation (LDA) combined with the on-site Coulomb repulsion parameter <i>U</i> to accurately describe the strongly correlated system. For the specific value of <i>U</i>, we adopt 3.5 eV and 7.6 eV to describe the strong correlation of 3d electrons of Ti<sup>4+</sup> ions and 4f electrons of Er<sup>3+</sup> ions, respectively. According to the calculation of electronic properties, the band gap value of Er<sup>3+</sup> doped TiO<sub>2</sub> is about 2.27 eV, which is lower than that of the host crystal (<i>E</i><sub>g</sub> = 2.40 eV). The results show that the reduction in the band gap is mainly caused by the f state of Er<sup>3+</sup> ions. The doping of Er ion does reduce the band gap value, but it does not change the conductivity of the system, which have great application prospect in diode-pumped laser. These findings not only provide the data for further exploring the properties and applications of Er<sup>3+</sup>:TiO<sub>2</sub> crystals, but also present an approach to studying other rare-earth-doped crystalline materials.