Abstract The first study of ϕ-meson production in p–Pb collisions at forward and backward rapidity, at a nucleon–nucleon centre-of-mass energy s NN = 5.02 TeV , has been performed with the ALICE apparatus at the LHC. The ϕ-mesons have been identified in the dimuon decay channel in the transverse momentum ( p T ) range 1 < p T < 7 GeV / c , both in the p-going ( 2.03 < y < 3.53 ) and the Pb-going ( − 4.46 < y < − 2.96 ) directions — where y stands for the rapidity in the nucleon–nucleon centre-of-mass — the integrated luminosity amounting to 5.01 ± 0.19 nb − 1 and 5.81 ± 0.20 nb − 1 , respectively, for the two data samples. Differential cross sections as a function of transverse momentum and rapidity are presented. The forward–backward ratio for ϕ-meson production is measured for 2.96 < | y | < 3.53 , resulting in a ratio ∼0.5 with no significant p T dependence within the uncertainties. The p T dependence of the ϕ nuclear modification factor R pPb exhibits an enhancement up to a factor 1.6 at p T = 3 – 4 GeV / c in the Pb-going direction. The p T dependence of the ϕ-meson cross section in pp collisions at s = 2.76 TeV , which is used to determine a reference for the p–Pb results, is also presented here for 1 < p T < 5 GeV / c and 2.5 < y < 4 , for a 78 ± 3 nb − 1 integrated luminosity sample.