In react you can transfer static files in the build folder to cpanel, direct admin or other shared server.
What is the solution for nextjs?
without using the nodejs and install it on the server
In react you can transfer static files in the build folder to cpanel, direct admin or other shared server.
What is the solution for nextjs?
without using the nodejs and install it on the server
2
Answers
I found the way myself.
On a dedicated server, as long as you are connected to the server using Putty, you can load the site by creating a virtual host. by example
If you enter the domain address in the browser, the server points to the localhost address and port 8080, on which Nextjs is running.
After completing the steps, you can go to the root of your project and run Nextjs as like it is on your computer using the command npm run dev or next start or etc
but after close putty everything expire, using pm2 for this problem
If your application does not generate dynamic pages at runtime you can use nextjs export static which will generate static HTML for you and then you could deploy on cpanel