We present an efficient approach for simulating Coulomb systems confined by planar polarizable surfaces. The method is based on the solution of the Poisson equation using periodic Green functions. It is shown that the electrostatic energy arising from the surface polarization can be decoupled from the energy due to the direct Coulomb interaction between the ions. This allows us to combine an efficient Ewald summation method, or any other fast method for summing over the replicas, with the polarization contribution calculated using Green function techniques. We apply the method to calculate density profiles of ions confined between the charged dielectric and metal surfaces.