The main objective of this paper is to study the free vibration of a Timoshenko–Ehrenfest single-walled carbon nanotube based on the nonlocal theory and taking surface effects into account. To model these effects on frequency response of nanotubes, we use Eringen’s nonlocal elastic theory and surface elastic theory proposed by Gurtin and Murdoch to modify the governing equation. A modified version of Timoshenko nonlocal elasticity theory—known as the nonlocal truncated Timoshenko beam theory—is put forth to investigate the free vibration behavior of single-walled carbon nanotubes (SWCNTs). Using Hamilton’s principle, the governing equations and the corresponding boundary conditions are derived. Finally, to check the accuracy and validity of the proposed method, some numerical examples are carried out. The impacts of the nonlocal coefficient, surface effects, and nanotube length on the free vibration of single-walled carbon nanotubes (SWCNTs) are evaluated, and the results are compared with those found in the literature. The findings indicate that the length of the nanotube, the nonlocal parameter, and the surface effect all play important roles and should not be disregarded in the vibrational analysis of nanotubes. Finally, the results show how effective and successful the current formulation is at explaining the behavior of nanobeams.