  We study the deformation theory of nearly $\mathrm{G}_2$ manifolds. These are
seven dimensional manifolds admitting real Killing spinors. We show that the
infinitesimal deformations of nearly $\mathrm{G}_2$ structures are obstructed
in general. Explicitly, we prove that the infinitesimal deformations of the
homogeneous nearly $\mathrm{G}_2$ structure on the Aloff--Wallach space are all
obstructed to second order. We also completely describe the cohomology of
nearly $\mathrm{G}_2$ manifolds.
