In the present study, free vibration of single-walled carbon nanotubes (SWCNTs) with restrained boundary conditions is studied using nonlocal elasticity theory. To give generality to the present problem, the SWCNT is assumed to be elastically restrained by means of rotational and translational springs at the ends. The lateral displacement function is considered to be in the form of a Fourier sine series. The first, second and higher order derivatives of the Fourier sine series are legitimized using Stoke's transformation. The main advantage of this transformation is its capability of dealing with various boundary conditions to determine the vibration frequencies. Numerical results are given for different nonlocality parameters, different length of SWCNTs and different boundary conditions. The present formulation can be used for the dynamic analyses of SWCNTs with generally restrained boundary conditions.