Abstract Effects of alkaline earth metal atoms doping in boron hydrides at high pressure are investigated by first-principles calculations. The calculated results showed that doping with Mg, Ca, Ba, and Sr in B8H16 at 50 GPa is thermodynamically favorable and dynamically stable. The doping changes the B8H16 from a semiconductor to a metal with substantial electronic density-of-state around the Fermi level. The superconductivity of the alkaline earth metal doped B8H16 is studied based on electron-phonon coupling mechanism. The calculated critical superconducting transition temperatures (Tc) range from 10 to 25 K at 50 GPa upon doping. These results suggest that doping metal atoms in boron hydrides is an efficient way in designing superconducting materials.