Nonlinear transverse free vibrations of porous functionally-graded (FG) Bernoulli–Euler nanobeams in hygrothermal environments through the local/nonlocal stress gradient theory of elasticity were studied. By using the Galerkin method, the governing equations were reduced to a nonlinear ordinary differential equation. The closed form analytical solution of the nonlinear natural flexural frequency was then established using the higher-order Hamiltonian approach to nonlinear oscillators. A numerical investigation was developed to analyze the influence of different parameters both on the thermo-elastic material properties and the structural response, such as material gradient index, porosity volume fraction, nonlocal parameter, gradient length parameter, mixture parameter, and the amplitude of the nonlinear oscillator on the nonlinear flexural vibrations of metal–ceramic FG porous Bernoulli–Euler nano-beams.