For the first time, this paper investigates the forced vibrations of a functionally graded (FG) nanobeam with an accelerating moving load in a thermal environment. There is no exact coupling solution for the vibrations of nanobeam with an accelerated moving load, so this paper aims to provide a method to obtain an accurate solution for nanoscale structures with an accelerated moving load. The equations of motion are derived using Timoshenko's beam theory and the nonlocal strain gradient theory (NSGT). The Laplace method has been used to solve the coupling and exact differential equations. Then, by inverting Laplace from the coupled equations, an exact solution of the temporal response for FG nanobeam with constant acceleration and initial velocity in a thermal environment was obtained. The natural frequency was compared with previous works for validity and had acceptable results. Finally, the effect of parameters such as changes in acceleration and velocity of moving force, negative acceleration, power law index of FG material, different temperatures, nonlocal parameter, and longitudinal scale parameter on the maximum dynamic displacement of nanobeam is investigated. These results can be used better to design FG nanostructures with accelerated moving loads. Considering the sensitivity of data analysis in nano dimensions, it is necessary to provide an analytical solution method in these dimensions to reduce the error percentage in nano dimensions to zero. which is presented in this work for the first time.