Beamline I07 at Diamond Light Source is dedicated to the study of the structure of surfaces and interfaces for a wide range of sample types, from soft matter to ultrahigh vacuum. The beamline operates in the energy range 8-30 keV and has two endstations. The first houses a 2+3 diffractometer, which acts as a versatile platform for grazing-incidence techniques including surface X-ray diffraction, grazing-incidence small- (and wide-) angle X-ray scattering, X-ray reflectivity and grazing-incidence X-ray diffraction. A method for deflecting the X-rays (a double-crystal deflector) has been designed and incorporated into this endstation, extending the surfaces that can be studied to include structures formed on liquid surfaces or at liquid-liquid interfaces. The second experimental hutch contains a similar diffractometer with a large environmental chamber mounted on it, dedicated to in situ ultrahigh-vacuum studies. It houses a range of complementary surface science equipment including a scanning tunnelling microscope, low-energy electron diffraction and X-ray photoelectron spectroscopy ensuring that correlations between the different techniques can be performed on the same sample, in the same chamber. This endstation allows accurate determination of well ordered structures, measurement of growth behaviour during molecular beam epitaxy and has also been used to measure coherent X-ray diffraction from nanoparticles during alloying.