We develop the theory of left-invariant generalized pseudo-Riemannian metrics on Lie groups. Such a metric accompanied by a choice of left-invariant divergence operator gives rise to a Ricci curvature tensor, and we study the corresponding Einstein equation. We compute the Ricci tensor in terms of the tensors (on the sum of the Lie algebra and its dual) encoding the Courant algebroid structure, the generalized metric, and the divergence operator. The resulting expression is polynomial and homogeneous of degree 2 in the coefficients of the Dorfman bracket and the divergence operator with respect to a left-invariant orthonormal basis for the generalized metric. We determine all generalized Einstein metrics on three-dimensional Lie groups.