Abstract. The Hyperboloidal Foliation Method (introduced by the authors in 2014) is extended here and applied to the Einstein equations of general relativity. Specifically, we establish the nonlinear stability of Minkowski spacetime for self-gravitating massive scalar fields, while existing methods only apply to massless scalar fields. First of all, by analyzing the structure of the Einstein equations in wave coordinates, we exhibit a nonlinear wave-Klein-Gordon model defined on a curved background, which is the focus of the present paper. For this model, we prove here the existence of global-in-time solutions to the Cauchy problem, when the initial data have sufficiently small Sobolev norms. A major difficulty comes from the fact that the class of conformal Killing fields of Minkowski space is significantly reduced in presence of a massive scalar field, since the scaling vector field is not conformal Killing for the Klein-Gordon operator. Our method relies on the foliation (of the interior of the light cone) of Minkowski spacetime by hyperboloidal hypersurfaces and uses Lorentz-invariant energy norms. We introduce a frame of vector fields adapted to the hyperboloidal foliation and we establish several key properties: Sobolev and Hardy-type inequalities on hyperboloids, as well as sup-norm estimates which correspond to the sharp time decay for the wave and the Klein-Gordon equations. These estimates allow us to control interaction terms associated with the curved geometry and the massive field, by distinguishing between two levels of regularity and energy growth and by a successive use of our key estimates in order to close a bootstrap argument.