Nitrogen vacancy (NV) centers in diamonds have been explored for a wide range of sensing applications in the last decade due to their unique quantum properties. In this work, we report a compact and portable magnetometer with an ensemble of NV centers, which we call the Quantum MagPI (Quantum Magnetometer with Proportional Integral control). Our fully integrated compact sensor assembly and control electronics fit inside a 10 × 10 × 7 cm3 box and a 30 × 25 × 5 cm3 rack-mountable box, respectively. We achieve a bandwidth normalized sensitivity of ∼10 nT/Hz. Using closed-loop feedback for locking to the resonance frequency, we extend the linear dynamic range to 200 μT (20× improvement compared to the intrinsic dynamic range) without compromising the sensitivity. We report a detailed performance analysis of the magnetometer through measurements of noise spectra, Allan deviation, and tracking of nT-level magnetic fields in real-time. In addition, we demonstrate the utility of such a magnetometer by real-time tracking of the movement of an elevator car and door opening events by measuring the projection of the magnetic field along one of the NV-axes under ambient temperature and humidity conditions.