The buckling of nanostructures including as a nanobeam, nanorod, and nanotube in a temperature field is investigated based on the non-local elasticity field theory with non-linear strain gradients first proposed by Eringen. New higher-order governing differential equations both in transverse and axial direction for buckling of such nanostructures are derived based on the exact variational principle approach with corresponding higher-order non-local boundary conditions. Based on these new governing equations and boundary conditions, new analytical solutions for some practical examples on buckling of nanostructures are presented and analyzed in detail. Subsequently, the effects of non-local nanoscale and temperature change on critical buckling load are analyzed and discussed. It is observed that those factors have great influence on the critical buckling load of the nanostructures. In particular, the non-local stress very much affects the stiffness of nanostructures and the critical buckling load is significantly increased in the presence of non-local stress. The paper concludes that at low and room temperature the critical buckling load of nanostructures increases with increasing temperature change, while at high temperature the critical buckling load decreases with increasing temperature change. A critical temperature change which causes buckling without external load is also derived and discussed.