The pseudorapidity density of charged particles, dNch/dη, at midrapidity in Pb-Pb collisions has been measured at a center-of-mass energy per nucleon pair of sNN=5.02 TeV. For the 5% most central collisions, we measure a value of 1943±54. The rise in dNch/dη as a function of sNN is steeper than that observed in proton-proton collisions and follows the trend established by measurements at lower energy. The increase of dNch/dη as a function of the average number of participant nucleons, Npart, calculated in a Glauber model, is compared with the previous measurement at sNN=2.76 TeV. A constant factor of about 1.2 describes the increase in dNch/dη from sNN=2.76 to 5.02 TeV for all centrality classes, within the measured range of 0%-80% centrality. The results are also compared to models based on different mechanisms for particle production in nuclear collisions.