The DArk Matter Particle Explorer (DAMPE) is a space experiment designed to search for dark matter indirectly by measuring the spectra of photons, electrons, and positrons up to 10 TeV. The BGO electromagnetic calorimeter (ECAL) is its main sub-detector for energy measurement. In this paper, the instrumentation and development of the BGO ECAL is briefly described. The calibration on the ground, including the pedestal, minimum ionizing particle (MIP) peak, dynode ratio, and attenuation length with the cosmic rays and beam particles is discussed in detail. Also, the energy reconstruction results of the electrons from the beam test are presented.