Steps to setup Web Application
We are using a simple Next.js application but you can use what ever you want. Remeber to change the port number accordingly. Next.js by default uses port 3000.
Step 1: Install git and vim in instance
sudo apt install git vim
Step 2: Install Node.js
curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt install nodejs
Verify the installation
node --version
Step 3: Install pnpm globally
curl -fsSL https://get.pnpm.io/install.sh | sh -
Step 4: Clone the repo and make the production build
git clone https://github.com/sarthakroy107/reg-form.git && cd reg-form && pnpm i && pnpm build
Step 5: We want to run our application in background, so need a process manager, so we are going to install pm2
pnpm add -g pm2 && pm2 start pnpm -- run start && pm2 list
One process is running which is our Next.js application. It is running in port 3000 but still will not be able to access the website using public ip address as AWS in not listening to inbound traffic in port 3000. So we have expose port 3000 first.
How to Install an SSL/TLS Certificate In Amazon EC2 (AWS)
AWS EC2 is one of the most used and convenient solutions for hosting web servers and applications accessible worldwide. Securing your applications with an SSL certificate is vital for safeguarding user data and building trust. In this article, we will be hosting a basic web application on EC2 and will be generating and installing an SSL certificate to ensure a secure browsing experience for your users. By following these steps, you can effectively deploy and protect your web applications on AWS EC2, bolstering security and user confidence for absolutely free.
Contact Us