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?
Open GiT BASH
-
Connect to the instance: ssh -i your-key.pem ubuntu@ip address
When prompted, type yes and press Enter. -
Upgrade the system and Install: to upgrade(sudo apt install nginx -y) and to install(sudo apt install nginx -y).
-
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). -
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.