The poor thermostability of native cyclodextrin glycosyltransferases (CGTases), which are essential for cyclodextrin production, limits their use in industrial applications. The effects of 4 divalent metal ions (Ca2+, Ba2+, Zn2+, and Mg2+) on the thermostability of the α-CGTase from Paenibacillus macerans JFB05-01 were investigated. The addition of Ca2+ or Ba2+ to the α-CGTase solution significantly enhanced the enzyme's thermostability, while the presence of Zn2+ or Mg2+ had little effect. The greatest increase in α-CGTase thermostability was obtained with a final concentration of 1.5 mM Ba2+ or 0.5 mM Ca2+. Under these conditions, the α-CGTase solutions retained 56.1 or 29.1%, respectively, of their initial cyclization activity after 120 min at 60 °C. Mechanistic analyses showed that the addition of Ca2+ or Ba2+ significantly protected the secondary and tertiary structures of α-CGTase. This study provides a theoretical foundation and a useful strategy for improving the thermostability of enzymes.