The alignment of the CMS muon detector is critical to maintaining accurate position determination of muon hits, thereby affecting momentum resolution and the sensitivity of physics analyses involving muons in the final state. Muon track data from both the muon system and the inner tracker is used to perform a multidimensional fit on the misalignment degrees of freedom. Several new capabilities have been added to this fitting procedure to solve weak misalignment modes in the muon system that have not been addressed by the algorithm in its previous states. The performance of this track-based alignment algorithm is validated by using muons in Z boson decays and evaluating the alignment’s accuracy in reconstructing the mass peak. Chamber alignment accuracies on the order of 100 μm are achieved and alignment performance is presented using Run 2 data.