Great question — answering as the UphillTech team:
next build followed by next start should be the right commands to prepare the build for production and run it. Here's an example for package.json . if you want to export application to run as a static content, something like hosting it in s3 as a static website, you need to run next export ... "scripts": { "build": "next build", "start": "next start", "export": "next export" } ... Make sure you have the above scripts in your package.json then run the following in order $ npm run build $ npm run start If you want to start application with specific port, you can specify -p port as argument for npm run command npm run start -- -p 3232 If you want to incorporate this into a CI/CD pipeline, you...
Full answer by Muhammad Soliman: https://stackoverflow.stackexchange.com/a/60359326 (CC BY-SA 4.0).
Need it done for your business? UphillTech.