The muon system of the CMS experiment is expected to upgrade all of its subdetectors for the Phase-2 of the Large Hadron Collider (LHC) that will begin in 2029. The upgrade plans for drift tubes (DTs), cathode strip chambers (CSCs) and resistive place chambers (RPCs) include a new electronics for better performance in high background rate conditions and to sustain the large radiation dose delivered by the high-luminosity LHC (HL-LHC). Two new RPC stations will also be installed to complement CSCs in the forward region 1.8 < |η| < 2.4, while three stations of triple-GEM (gas electron multiplier) detectors will complement CSCs in the region 1.5 < |η| < 2.4 and extend the CMS muon system coverage to the very forward pseudorapidity region 2.4 < |η| < 2.8. We present the goals and status of the CMS muon system upgrade including the performance of the early Phase-2 upgrades demonstrated in Run 3 with proton-proton collisions, the performance validation of the new detectors in test beams and the mass production status of the new stations.