The self-consistent quantum-electrostatic (also known as Poisson-Schr\"odinger) problem is notoriously difficult in situations where the density of states varies rapidly with energy. At low temperatures, these fluctuations make the problem highly non-linear which renders iterative schemes deeply unstable. We present a stable algorithm that provides a solution to this problem with controlled accuracy. The technique is intrinsically convergent including in highly non-linear regimes. We illustrate our approach with (i) a calculation of the compressible and incompressible stripes in the integer quantum Hall regime and (ii) a calculation of the differential conductance of a quantum point contact geometry. Our technique provides a viable route for the predictive modeling of the transport properties of quantum nanoelectronics devices.