In the present article we describe a new setup for an atomic force microscope in the beetle-type geometry. The microscope consists of a compact head standing on three piezo legs with a fourth central piezo carrying the cantilever tip. We use the laser beam deflection method to detect the deflection of the cantilever. All optical components are integrated into the microscope head which has a diameter of 40 mm. This compactness results in a high mechanical stability, while the adjustment of the optical pathway is still easy to handle. The microscope can be used in UHV and in air. Measurements on KBr(100) in air show the capability of the microscope to obtain a resolution up to atomic corrugations. (C) 1996 American Institute of Physics.