We consider the Bose-Hubbard model on a two-leg ladder under an artificial magnetic field and investigate the superfluid-to-Mott insulator transition in this setting. Recently, this system has been experimentally realized [M. Atala et al., Nature Phys. 10, 588 (2014)], albeit in a parameter regime that is far from the Mott transition boundary. Depending on the strength of the magnetic field, the single-particle spectrum has either a single ground state or two degenerate ground states. The transition between these two phases is reflected in the many-particle properties. We first investigate these phases through the Bogoliubov approximation in the superfluid regime and calculate the transition boundary for weak interactions. For stronger interactions the system is expected to form a Mott insulator. We calculate the Mott transition boundary as a function of the magnetic field and interleg coupling with mean-field theory, strong-coupling expansion, and density matrix renormalization group (DMRG). Finally, using the DMRG, we investigate the particle-hole excitation gaps of this system at different filling factors and find peaks at simple fractions, indicating the possibility of correlated phases.