The cerebellum is involved in encoding balance, posture, speed, and gravity during locomotion. However, most studies are carried out on flat surfaces, and little is known about cerebellar activity during free ambulation on slopes. Here, it has been imaged the neuronal activity of cerebellar molecular interneurons (MLIs) and Purkinje cells (PCs) using a miniaturized microscope while a mouse is walking on a slope. It has been found that the neuronal activity of vermal MLIs specifically enhanced during uphill and downhill locomotion. In addition, a subset of MLIs is activated during entire uphill or downhill positions on the slope and is modulated by the slope inclines. In contrast, PCs showed counter-balanced neuronal activity to MLIs, which reduced activity at the ramp peak. So, PCs may represent the ramp environment at the population level. In addition, chemogenetic inactivation of lobule V of the vermis impaired uphill locomotion. These results revealed a novel micro-circuit in the vermal cerebellum that regulates ambulatory behavior in 3D terrains.