We describe the design and construction of a new type of AFM cell for in situ imaging under potentiostatic control. The cell is specifically designed for a Rasterscope 4000TM AFM instrument with no need for instrumental modification, but can easily be adapted to other commercial instruments. The cell is a closed system with insignificant sample evaporation. It is a chemically and mechanically robust two-component system which enables fast assembly and testing prior to insertion and minimizes leakage problems. The cell is also laterally flexible, facilitating scanning of large areas, holds inlets for rapid flushing and change of solution, and contains an optical device for adjusting the laser beam deflection in aqueous and gas ambient environments. Cyclic voltammetry of a simple redox couple and combined cyclic voltammetry and in situ AFM of copper deposition/ dissolution cycles testify to perfect cell performance.