We derive well-posed boundary conditions for the two-dimensional shallow water equations by using the energy method. Both the number and the type of boundary conditions are presented for subcritical and supercritical flows on a general domain. Then, as an example, the boundary conditions are discussed for a rectangular domain.