The production yield and angular anisotropy of prompt Ds+ mesons were measured as a function of transverse momentum (pT) in Pb–Pb collisions at a centre-of-mass energy per nucleon pair sNN=5.02TeV collected with the ALICE detector at the LHC. Ds+ mesons and their charge conjugates were reconstructed at midrapidity (|y|<0.5) from their hadronic decay channel Ds+→ϕπ+, with ϕ→K−K+, in the pT intervals 2<pT<50GeV/c and 2<pT<36GeV/c for the 0–10% and 30–50% centrality intervals. For pT>10GeV/c, the measured Ds+-meson nuclear modification factor RAA is consistent with the one of non-strange D mesons within uncertainties, while at lower pT a hint for a Ds+-meson RAA larger than that of non-strange D mesons is seen. The enhanced production of Ds+ relative to non-strange D mesons is also studied by comparing the pT-dependent Ds+/D0 production yield ratios in Pb–Pb and in pp collisions. The ratio measured in Pb–Pb collisions is found to be on average higher than that in pp collisions in the interval 2<pT<8GeV/c with a significance of 2.3σ and 2.4σ for the 0–10% and 30–50% centrality intervals. The azimuthal anisotropy coefficient v2 of prompt Ds+ mesons was measured in Pb–Pb collisions in the 30–50% centrality interval and is found to be compatible with that of non-strange D mesons. The main features of the measured RAA, Ds+/D0 ratio, and v2 as a function of pT are described by theoretical calculations of charm-quark transport in a hydrodynamically expanding quark–gluon plasma including hadronisation via charm-quark recombination with light quarks from the medium. The pT-integrated production yield of Ds+ mesons is compatible with the prediction of the statistical hadronisation model.