Buckling and post-buckling analysis is presented for axially compressed double-walled carbon nanotubes (CNTs) embedded in an elastic matrix in thermal environments. The double-walled carbon nanotube is modeled as a nonlocal shear deformable cylindrical shell, which contains small scale effects and van der Waals interaction forces. The surrounding elastic medium is modeled as a tensionless Pasternak foundation. The post-buckling analysis is based on a higher order shear deformation shell theory with the von Kármán–Donnell-type of kinematic nonlinearity. The thermal effects are also included and the material properties are assumed to be temperature-dependent and are obtained from molecular dynamics (MD) simulations. The nonlinear prebuckling deformations of the shell and the initial local point defect, which is simulated as a dimple on the tube wall, are both taken into account. A singular perturbation technique is employed to determine the post-buckling response of the tubes and an iterative scheme is developed to obtain numerical results without using any assumption on the shape of the contact region between the tube and the elastic medium. The small scale parameter $e0a$ is estimated by matching the buckling loads of CNTs observed from the MD simulation results with the numerical results obtained from the nonlocal shear deformable shell model. Numerical solutions are presented to show the post-buckling behavior of CNTs surrounded by an elastic medium of conventional and tensionless Pasternak foundations. The results show that buckling and post-buckling behavior of CNTs is very sensitive to the small scale parameter $e0a$. The results reveal that the unilateral constraint has a significant effect on the post-buckling response of CNTs when the foundation stiffness is sufficiently large.