In recent years, the anomalous magnetic moment of the muon has triggered a lot of activity in the lattice QCD community because a persistent tension of about
is observed between the phenomenological estimate and the Brookhaven measurement. The current best phenomenological estimate has an uncertainty comparable to the experimental one and the error is completely dominated by hadronic effects: the leading order hadronic vacuum polarization (HVP) contribution and the hadronic light-by-light (HLbL) scattering contribution. Both are accessible via lattice simulations and a reduction of the error by a factor 4 is required in view of the forthcoming experiments at Fermilab and J-PARC whose results, expected in the next few years, should reduce the experimental precision down to the level of 0.14 ppm. In this article, I review the status of lattice calculations of those quantities, starting with the HVP. This contribution has now reached sub-percent precision and requires a careful understanding of all sources of systematic errors. The HLbL contribution, that is much smaller, still contributes significantly to the error. This contribution is more challenging to compute, but rapid progress has been made on the lattice in the last few years.