Next.js Discord

Discord Forum

Needed files for selfhosting

American Sable posted this in #help-forum
Open in Discord
American SableOP
Nextjs' documentation seems to be a bit sparse on how to self host my application.
After I run "npm run build" and the .next-folder is created, which files do I need to copy on my server?
I had the idea that the ".next"-folder is self contained, but I need at least the "node_modules" (for the next binary) and the package.json to be able to run "start".

1 Reply

you should either build on the server and run normaly, or use standalone and only need to make sure you have node for starting: