We present the first results of hydrodynamical simulations that follow the formation of galaxies to the present day in nearly spherical regions of radius ∼20 h−1 Mpc drawn from the Millennium Simulation (Springel et al.). The regions have mean overdensities that deviate by (−2, −1, 0, +1, +2)σ from the cosmic mean, where σ is the rms mass fluctuation on a scale of ∼20 h−1 Mpc at z= 1.5. The simulations have mass resolution of up to ∼106 h−1 M⊙, cover the entire range of large-scale cosmological environments, including rare objects such as massive clusters and sparse voids, and allow extrapolation of statistics to the (500 h−1 Mpc)3 Millennium Simulation volume as a whole. They include gas cooling, photoheating from an imposed ionizing background, supernova feedback and galactic winds, but no AGN. In this paper, we focus on the star formation properties of the model. We find that the specific star formation rate density at z≲ 10 varies systematically from region to region by up to an order of magnitude, but the global value, averaged over all volumes, closely reproduces observational data. Massive, compact galaxies, similar to those observed in the GOODS fields (Wiklind et al.), form in the overdense regions as early as z= 6, but do not appear in the underdense regions until z∼ 3. These environmental variations are not caused by a dependence of the star formation properties on environment, but rather by a strong variation of the halo mass function from one environment to another, with more massive haloes forming preferentially in the denser regions. At all epochs, stars form most efficiently in haloes of circular velocity vc∼ 250 km s−1. However, the star formation history exhibits a form of ‘downsizing’ (even in the absence of AGN feedback): the stars comprising massive galaxies at z= 0 have mostly formed by z= 1−2, whilst those comprising smaller galaxies typically form at later times. However, additional feedback is required to limit star formation in massive galaxies at late times.