Prerequisites

  1. We need a EC2 instance or any other VM on AWS or GCP
  2. We need a Nextjs project , without any build errors
  3. We need Docker Engine  Installed in our system to run docker command and making Images
  4. And a Domain on Hostinger , GoDaddy or Neamcheap to Put DNS Records

EC2 on AWS

Installing Docker on EC2

curl -fsSL <https://get.docker.com> | sudo bash
sudo usermod -aG docker $USER
newgrp docker
docker --version
docker run hello-world

image.png

Now Install Nginx on EC2