In this paper, the thermal buckling behavior of single-walled carbon nanotubes (SWCNTs) embedded in an elastic medium is studied. To this end, the SWCNTs are modeled based on the nonlocal Timoshenko beam theory into which the effect of the elastic medium is incorporated The generalized differential quadrature (GDQ) method is employed to discretize the governing differential equations and to consider different commonly used boundary conditions (BCs). For simply supported BCs, the results obtained from the present analysis are compared with the ones from the exact solution and an excellent agreement has been achieved. The effects of the aspect ratio, nonlocal parameter and the Winkler parameter on the dimensionless critical buckling temperature are carefully investigated.