The Shan and Chen single component multiphase lattice Boltzmann model is used to simulate homogeneous and heterogeneous cavitation. The simulations show excellent agreement with the equation of state for homogeneous cavitation and with energy considerations based on interface formation and bubble expansion for heterogeneous cavitation.