Manually Deploy Next.js on AWS EC2 with Shell Script

Do you want to know how to manually deploy an application without all advanced tools, just use shell script on Linux? Before we have CI/CD, Github Actions, AWS Codedeploy, etc. developers need to manually execute scripts to deploy, and I will show you brief steps to complete it.

Let me show you with a Next.js application, and I will deploy it on AWS EC2.

Once you connect to your server, execute the following code:

The command (npm run start > /dev/null 2>&1 &) is the key part:

ссс