An analytical method to predict the thermal buckling of simply supported and clamped-clamped FGM box beams is presented in this paper. By means of Galerkin’s method, a new expression of the critical moment inducing lateral buckling for simply supported beams under thermo-mechanical loads is established. The beam thermo-mechanical properties are graded along the wall thickness according to a power law of the porous volume fraction. The critical temperature gradients given by the present method are compared to those provided by the commercial FEM code Abaqus, and the difference among the results is quite small. To investigate the effects of temperature and porosity on the instabilities of beams, some numerical examples are presented.