Performing atomic force microscopy (AFM) and scanning tunneling microscopy (STM) with atomic resolution under ambient conditions is challenging due to enhanced noise and thermal drift. We show the design of a compact combined atomic force and scanning tunneling microscope that uses qPlus sensors and discuss the stability and thermal drift. By using a material with a low thermal expansion coefficient, we can perform constant height measurements and achieve atomic resolution in both AFM and STM on various samples. Moreover, the design allows a wide angle optical access to the sensor and the sample that is of interest for combining with optical microscopes or focusing optics with a high numerical aperture.