Deploying my portfolio on an EC2 and setting up the domain name using Route53.

Mokadi Surya Prasad
4 min readMay 25, 2024

--

Launch an EC2 Instance:

  • Log in to your AWS Management Console.
  • Navigate to the EC2 service.
  • Launch a new EC2 instance. Choose an Amazon Machine Image (AMI) that suits your needs (e.g., Amazon Linux, Ubuntu, etc.), configure the instance type, network settings, and security group (ensure port 80 is open for HTTP traffic).

Configure Security Group:

  • Make sure your EC2 instance’s security group allows inbound traffic on port 80 (HTTP) and port 443 (HTTPS) if you plan to use HTTPS.

Connect to Your EC2 Instance with MobaXterm:

  • Once your EC2 instance is running, connect to it using SSH. You can use the SSH key pair you specified when launching the instance.

Set Up Your Portfolio:

  • Install the necessary software on your EC2 instance (e.g., Apache, Nginx, etc.).
  • I am installing Nginx in my EC2 instance.

Updates the package list on the system and installs Certbot, a tool for obtaining SSL certificates from Let’s Encrypt, and the Certbot plugin for nginx.

  • Upload your portfolio files to the appropriate directory on your EC2 instance.
  • Creates a directory structure to host the website files for the domain suryaprasad.xyz.
  • give the ownership of the directory to the current user.
  • give the permissions of the directory to allow read, write, and execute access for the owner and read and execute access for others
  • Opens a text editor (nano) to create/edit the HTML file for the website homepage. You will paste the provided HTML code into this file.

Configure Route 53:

  • Go to the Route 53 console in the AWS Management Console.
  • Click on “Hosted zones” and then “Create hosted zone.”
  • Entered my domain name and created the hosted zone.
  • Route 53 will provides me with four nameservers. Take note of these nameservers.

Update Domain Registrar:

  • Log in to your domain registrar’s website (I bought my domain name in GoDaddy).
  • I Update the DNS nameservers in GoDaddy for my domain to use the four nameservers provided by Route 53.

Create Record Sets:

  • Inside my Route 53 hosted zone, I created an A record that points to the Elastic IP (EIP) address of my EC2 instance. This will map my domain name to my EC2 instance’s IP address.
  • Optionally, I created other DNS records like CNAME, MX, etc., as needed for my portfolio.

Test Your Setup:

  • Wait for the DNS changes to propagate (usually takes some time, up to 48 hours).
  • Once propagated, I should be able to access my portfolio using your domain name in a web browser.

Configure SSL/TLS :

  • I Uses Certbot to obtain a SSL certificate from Let’s Encrypt for the domain suryaprasad.xyz and any subdomains (.suryaprasad.xyz) using DNS verification.

--

--

Mokadi Surya Prasad
Mokadi Surya Prasad

No responses yet