Setting up NGINX on Ubuntu Server

Procuring a Server

Before installing and configuring NGINX, the first step was to procure a fresh Ubuntu server. Here’s how I went about it:

Step 1: Choose a Cloud Provider:
There are several reliable cloud providers like AWS, DigitalOcean, Linode, or Vultr. For this exercise, I opted for AWS (Hire AWS Developers) due to its user-friendly interface and quick server deployment.

Sign Up and Log In to AWS:
At this point if you haven’t sign up for an AWS account at aws.amazon.com. Ensure to enable MFA (Multi-Factor Authentication) when you login, either using an Authenticator app or a passkey. Once your account is active, log in to the AWS Management Console.

Step 2: Launch an EC2 Instance

  • Navigate to the EC2 Dashboard and click "Launch Instance."

  • Choose an AMI: Select Ubuntu.

  • Select Instance Type: Choose the t2.micro (free tier eligible) is ideal for testing.

  • Configure Instance Details and Storage: Accept default settings.

  • Set Up Security Groups:

    • Allow SSH (port 22) for remote access.

    • Allow HTTP (port 80) to serve web traffic.

  • Enter a new key pair name (e.g ubuntu-key), click to create a new key pair, and it will be automatically downloaded to your PC (ubuntu-key.pem).

  • Review and Launch: Confirm your settings, then launch the instance using your chosen key pair. This key is crucial for securely accessing your instance. Wait for the instance state to display as "Running," which may take a minute or two. Copy the public IPv4 address assigned to your instance, as it will be used to access the server and web page over the internet. Click on Connect at the top of the page.

Step 3: Access the Server via SSH
Navigate to the SSH Client tab and follow the instructions provided on how to change the permissions of your .pem file in a Terminal window then Connect to your instance using:

ssh -i /path/to/ubuntu-key.pem ubuntu@your_instance_public_ip

Make sure your key pair is secure and correctly referenced. I named my key - ubuntu-key.pem which is why it's used in the command. This step highlights the importance of careful credential management, a crucial element in both DevOps and cloud environments.

Step 4: Update the Server
After connecting, run:

sudo apt update

Installing and Configuring Nginx

Step 1: Install Nginx

Install the NGINX web server using the apt package manager. After installation, check the status of the NGINX service:

sudo apt install nginx -y
sudo systemctl status nginx
sudo systemctl enable nginx

Step 2: Configure the Custom Default HTML Page

Edit the default page located at /var/www/html/index.html using a code editor (vi, nano):

Note: Replace John Doe and johndoe with your actual name and Slack username as required in the task.

Reload the NGINX service to apply the updated configuration

sudo systemctl reload nginx

Reloading is a safe way to apply changes without a full restart, minimizing downtime. It’s a practical demonstration of efficient server management—a key trait for any DevOps Engineer.

Step 3: Test your web Server

Open a browser and navigate to your EC2 instance’s public IP (e.g., http://your_instance_public_ip). You should see the custom welcome message:

Welcome to DevOps Stage 0 - John Doe/johndoe


Configuring NGINX on an AWS Ubuntu server offered a practical experience in combining cloud management, server setup, and troubleshooting skills—essential for a successful career in both cloud and DevOps fields. Happy configuring!