The feasibility to generate powerful monochromatic radiation of the undulator type in the gamma region of the spectrum by means of planar channeling of ultrarelativistic electrons in a periodically bent crystal is proven. It is shown that to overcome the restriction due to the smallness of the dechanneling length, an electron-based crystalline undulator must operate in the regime of higher beam energies than a positron-based one does. A numerical analysis is performed for a 50 GeV electron channeling in Si along the (111) crystallographic planes.