We have developed the variable temperature scanning force microscope capable of performing both magnetic resonance force microscopy (MRFM) and magnetic force microscopy (MFM) measurements in the temperature range between 5 and 300 K. Modular design, large scanning area, and interferometric detection of the cantilever deflection make it a sensitive, easy to operate, and reliable instrument suitable for studies of the dynamic and static magnetization in various systems. We have verified the performance of the microscope by imaging vortices in a Nb thin film in the MFM mode of operation. MRFM spectra in a diphenyl-picryl-hydrazyl film were recorded to evaluate the MRFM mode of operation.