Sphagnum-dominated peatlands are major carbon pools and sinks, but these functions are threatened by climate change. There is, therefore, a need to better understand how microclimatic changes (soil temperature, soil moisture and water table depth) are affecting their functioning. Experimental studies on Sphagnum peatlands conducted under precisely controlled (e.g. mesocosm) conditions are relatively rare, especially those aiming to understand the system as a whole. Furthermore, mesocosm designs are generally described only briefly in the literature. In this article we provide a comprehensive account of a mesocosm experiment designed to study the response of Sphagnum peatlands to water table manipulation. We describe our experimental setup (3 water levels × 3 amplitudes of water table fluctuation × 5 replicates); and explain how we built the mesocosms, the issues we faced and the solutions we chose to solve them. We provide a detailed description of the devices we conceived to manipulate the water level, including software codes and electronic diagrams (as supplementary material), and explain how to address data loss in such an experimental design. We show that it is possible to build a reliable and powerful experimental setup at moderate cost using standard technology. The aim of this article is to provide a useful resource for researchers wishing to design similar experiments in the future. © 2015 International Mire Conservation Group and International Peat Society.