We present a scheme for a self-testing quantum random number generator. Compared to the fully device-independent model, our scheme requires an extra natural assumption, namely that the mean energy per signal is bounded. The scheme is self-testing, as it allows the user to verify in real-time the correct functioning of the setup, hence guaranteeing the continuous generation of certified random bits. Based on a prepare-and-measure setup, our scheme is practical, and we implement it using only off-the-shelf optical components. The randomness generation rate is 1.25 Mbits/s, comparable to commercial solutions. Overall, we believe that this scheme achieves a promising trade-off between the required assumptions, ease-of-implementation and performance.