During 2008 the ATLAS experiment went through an intense period of preparation to have the detector fully commissioned for the first beam period. In about 30 h of beam time available to ATLAS in 2008 the systems went through a rapid setup sequence, from successfully recording the first bunch ever reaching ATLAS, to setting up the timing of the trigger system synchronous to the incoming single beams. The so-called splash events were recorded, where the beam was stopped on a collimator 140 m upstream of ATLAS, showering the experiment with millions of particles per beam shot. These events were found to be extremely useful for timing setup. After the stop of the beam operation, the experiment went through an extensive cosmic ray data taking campaign, recording more than 500 million cosmic ray events. These events have been used to make significant progress on the calibration and alignment of the detector. This paper describes the commissioning programme and the results obtained from both the single beam data and the cosmic data recorded in 2008.