This paper investigates a phase-space density control based on configuration invariant for large-scale spacecraft swarms. By introducing Jordan-reduced dynamics and the configuration invariant to characterize relative orbits, the macroscopic swarm dynamics is presented with respect to the temporal evolution of phase space density. The density migration of the spacecraft swarm in phase space is modeled as a specific convection–diffusion process, where the diffusion term promotes swarm spreading and the convection term guides the swarm towards a designated region for uniform distribution. Through local density estimation and defining the convection and diffusion terms, the feedback control’s specific form is proposed and its exponential stability is proved. Particularly, the formulation of the convection term outside the target region and the combined kernel function for local density estimation help in avoiding sporadic isolated spacecraft. Numerical results of spacecraft swarm deployment validate the effectiveness and superiority of phase-space density control.