The apparent accelerating expansion of the universe is forcing us to examine the foundational aspects of the standard model of cosmology—in particular, the fact that dark energy is a direct consequence of the homogeneity assumption. We discuss the foundations of the assumption of spatial homogeneity, in the case when the Copernican principle is adopted. We present results that show how (almost) homogeneity follows from (almost) isotropy of various observables. The analysis requires fully nonlinear field equations—i.e. it is not possible to use second- or higher-order perturbation theory, since one cannot assume a homogeneous and isotropic background. Then we consider what happens if the Copernican principle is abandoned in our Hubble volume. The simplest models are inhomogeneous but spherically symmetric universes which do not require dark energy to fit the distance modulus. Key problems in these models are to compute the CMB anisotropies and the features of large-scale structure. We review how to construct perturbation theory on a non-homogeneous cosmological background, and discuss the complexities that arise in using this to determine the growth of large-scale structure.