The production of muons from heavy-flavour hadron decays in p–Pb collisions at √s NN = 5.02 TeV was studied for 2 <p T <16 GeV/c with the ALICE detector at the CERN LHC. The measurement was performed at forward (p-going direction) and backward (Pb-going direction) rapidity, in the ranges of rapidity in the centre-of-mass system (cms) 2.03 <y cms <3.53 and − 4.46 <y cms <− 2.96, respectively. The production cross sections and nuclear modification factors are presented as a function of transverse momentum (p T ). At forward rapidity, the nuclear modification factor is compatible with unity while at backward rapidity, in the interval 2.5 <p T <3.5 GeV/c, it is above unity by more than 2 σ . The ratio of the forward-to-backward production cross sections is also measured in the overlapping interval 2.96 <| y cms | <3.53 and is smaller than unity by 3.7 σ in 2.5 <p T <3.5 GeV/c. The data are described by model calculations including cold nuclear matter effects.