The production cross sections of Bs0 mesons and charge conjugates are measured in proton-proton (pp) and PbPb collisions via the exclusive decay channel Bs0→J/ψϕ→μ+μ−K+K− at a center-of-mass energy of 5.02 TeV per nucleon pair and within the rapidity range |y|<2.4 using the CMS detector at the LHC. The pp measurement is performed as a function of transverse momentum ( pT ) of the Bs0 mesons in the range of 7 to 50 GeV/ c and is compared to the predictions of perturbative QCD calculations. The Bs0 production yield in PbPb collisions is measured in two pT intervals, 7 to 15 and 15 to 50 GeV/ c , and compared to the yield in pp collisions in the same kinematic region. The nuclear modification factor ( RAA ) is found to be 1.5±0.6(stat)±0.5(syst) for 7–15 GeV/ c , and 0.87±0.30(stat)±0.17(syst) for 15–50 GeV/ c , respectively. Within current uncertainties, the Bs0 results are consistent with models of strangeness enhancement, and suppression by parton energy loss, as observed for the B+ mesons.