The work shows that the evolution of the field of the free Klein–Gordon equation (KGE), in the hydrodynamic representation, can be represented by the motion of a mass density ∝ | ψ | 2 subject to the Bohm-type quantum potential, whose equation can be derived by a minimum action principle. Once the quantum hydrodynamic motion equations have been covariantly extended to the curved space-time, the gravity equation (GE), determining the geometry of the space-time, is obtained by minimizing the overall action comprehending the gravitational field. The derived Einstein-like gravity for the KGE field shows an energy-impulse tensor density (EITD) that is a function of the field with the spontaneous emergence of the “cosmological” pressure tensor density (CPTD) that in the classical limit leads to the cosmological constant (CC). The energy-impulse tensor of the theory shows analogies with the modified Brans–Dick gravity with an effective gravity constant G divided by the field squared. Even if the classical cosmological constant is set to zero, the model shows the emergence of a theory-derived quantum CPTD that, in principle, allows to have a stable quantum vacuum (out of the collapsed branched polymer phase) without postulating a non-zero classical CC. In the classical macroscopic limit, the gravity equation of the KGE field leads to the Einstein equation. Moreover, if the boson field of the photon is considered, the EITD correctly leads to its electromagnetic energy-impulse tensor density. The work shows that the cosmological constant can be considered as a second order correction to the Newtonian gravity. The outputs of the theory show that the expectation value of the CPTD is independent by the zero-point vacuum energy density and that it takes contribution only from the space where the mass is localized (and the space-time is curvilinear) while tending to zero as the space-time approaches to the flat vacuum, leading to an overall cosmological effect on the motion of the galaxies that may possibly be compatible with the astronomical observations.