A future Electron-Ion Collider will enable the gluon contributions to the gravitational form factors of the proton to be constrained experimentally for the first time. Here, the first calculation of these form factors from lattice Quantum Chromodynamics is presented. The calculations use a largerthan-physical value of the light quark mass corresponding to mπ ∼ 450 MeV. All three form factors, which encode the momentum-dependence of the lowest moment of the spin independent gluon generalised parton distributions and are related to different components of the energy-momentum tensor, are resolved. In particular, the gluon D-term form factor, related to the pressure distribution inside the nucleon, is determined for the first time. The gluon contributions to the two gravitational form factors of the pion are also determined, and are compared to existing lattice determinations of the quark contributions to the gravitational form factors and to phenomenology. arXiv:1810.04626v1 [hep-lat]