Carbon nanotubes (CNTs) can be used as atomic force microscope (AFM) probes due to their robust mechanical properties, high aspect ratio and small diameter. In this study, a model of CNTs clamped in an elastic medium is proposed as CNT AFM probes. The buckling instability of the CNT probe clamped in elastic medium is analyzed based on the nonlocal Euler–Bernoulli beam model and the Whitney–Riley model. The clamped length of CNTs, and the stiffness of elastic medium affect largely on the stability of CNT AFM probe, especially at high buckling mode. The result shows that the buckling stability of the CNT AFM probe can be largely enhanced by increasing the stiffness of elastic medium. Moreover, the nonlocal effects of buckling instability are investigated and found to be lager for high buckling mode. The theoretical investigation on the buckling stability would give a useful reference for designing CNT as AFM probes.