We study analytically and by molecular dynamics simulations the ground state configuration of a system of magnetic dipoles fixed on a two-dimensional lattice. We find different phases, in close agreement with previous results. Building on this result and on the minimum energy requirement we determine the equilibrium lattice configuration, the magnetic order (ferromagnetic versus antiferromagnet...