In this paper, thermoelectric-mechanical buckling behavior of the piezoelectric nanobeams is investigated based on the nonlocal theory and Euler-Bernoulli beam theory. The electric potential is assumed linear through the thickness of the nanobeam and the governing equations are derived by Hamilton's principle. The governing equations are solved analytically for different boundary conditions. The effects of the nonlocal parameter, temperature change, and external electric voltage on the critical buckling load of the piezoelectric nanobeams are discussed in detail. This study should be useful for the design of piezoelectric nanodevices.