The production of ϒ mesons in Pb–Pb collisions at a centre-of-mass energy per nucleon pair sNN=5.02 TeV is measured with the muon spectrometer of the ALICE detector at the LHC. The yields as well as the nuclear modification factors are determined in the forward rapidity region 2.5<y<4.0, as a function of rapidity, transverse momentum and collision centrality. The results show that the production of the ϒ(1S) meson is suppressed by a factor of about three with respect to the production in proton–proton collisions. For the first time, a significant signal for the ϒ(2S) meson is observed at forward rapidity, indicating a suppression stronger by about a factor 2–3 with respect to the ground state. The measurements are compared with transport, hydrodynamic, comover and statistical hadronisation model calculations.