Abstract In this paper, we compute the first and second variation of the normalized Einstein–Hilbert functional on CR manifolds. We characterize critical points as pseudo-Einstein structures. We then turn to the second variation on standard spheres. While the situation is quite similar to the Riemannian case in dimension greater than or equal to five, in three dimensions, we observe a crucial difference, which mainly depends on the embeddable character of the perturbed CR structure.