🚀Your First EC2 Web Server with NGINX: A Quick Cloud Tutorial.

INTRODUCTION
Deploying a web server on the cloud doesn’t have to be complicated, and AWS makes it even easier. In this beginner-friendly guide, I’ll walk you through how I installed NGINX on an Ubuntu-based EC2 instance, step by step. Ubuntu is a popular, beginner-friendly Linux operating system often used on servers. NGINX (pronounced as “engine-x”) is a powerful, high-performance web server used to host websites and apps.

Before you begin, make sure you have the following in place: Make sure your AWS account is up and running. If you haven’t set one up yet, no worries, I’ve broken it down step-by-step in a previous guide. You’ll also need Git Bash for this setup, so be sure to download it if you haven’t already.”

Alright, let’s dive in, shall we?

  1. Login to your AWS account and create an instance:

  2. Name the Instance (mynginxweb):

  3. Select Ubuntu Server:

  4. Use t2 micro and select the already created key pair from the last article:

  1. Allow HTTP: with this setup, you’ll be able to view and test your work directly in the browser.

  2. Launch the Instance:

    Don’t forget to copy the Ip address

Open GiT BASH

  1. Connect to the key pair: _cd downloads.
    _

  2. Connect to the instance: ssh -i your-key.pem ubuntu@ip address

    When prompted, type yes and press Enter.

  3. Upgrade the system and Install: to upgrade(sudo apt install nginx -y) and to install(sudo apt install nginx -y).

  1. To start and Enable the NGINX: to Start(sudo systemctl start nginx) and to Enable(sudo systemctl enable nginx)

    You can also check if NGINX is running and active.(sudo systemctl status nginx).

  2. Go back to your instance dashboard and copy the IP address and paste it into your web browser. You should see the default NGINX welcome page!

I went further to customize my page with sudo nano /var/www/html/index.nginx-debian.html

:

🎉 That’s it! You’ve launched an Ubuntu EC2 instance, connected via SSH, installed NGINX, and served your first web page from the cloud, a solid first step into cloud computing and DevOps.

Until next time, stay curious.

Leave a Reply