The inclusive J/ψ production in Pb–Pb collisions at the center-of-mass energy per nucleon pair sNN = 5.02 TeV, measured with the ALICE detector at the CERN LHC, is reported. The J/ψ meson is reconstructed via the dimuon decay channel at forward rapidity (2.5 < y < 4) down to zero transverse momentum. The suppression of the J/ψ yield in Pb–Pb collisions with respect to binary-scaled pp collisions is quantified by the nuclear modification factor (RAA). The RAA at sNN = 5.02 TeV is presented and compared with previous measurements at sNN = 2.76 TeV as a function of the centrality of the collision, and of the J/ψ transverse momentum and rapidity. The inclusive J/ψ RAA shows a suppression increasing toward higher transverse momentum, with a steeper dependence for central collisions. The modification of the J/ψ average transverse momentum and average squared transverse momentum is also studied. Comparisons with the results of models based on a transport equation and on statistical hadronization are carried out. [Figure not available: see fulltext.]