DEV Community

Cover image for Nginx WebServer on Ubuntu OS running via EC2 (AWS)
Ola
Ola

Posted on

Nginx WebServer on Ubuntu OS running via EC2 (AWS)

Imagine you have a favorite game you like to play on your computer, but sometimes your computer might not be strong enough to run it well. Now, let's pretend there's a super strong computer far away that you can borrow to play your game. You can connect to this super strong computer from your own computer and play your game smoothly.

Ubuntu is like a special game or tool that people use on their computers to do a lot of important things. It's a*_ type of software called an operating system_*, just like how Windows or macOS helps you use your computer.

EC2, which stands for Elastic Compute Cloud, is like that super strong computer you can borrow. It's part of a big service called Amazon Web Services (AWS) that has lots of these strong computers all over the world.

So, when we say "Ubuntu running on EC2,"_ it means we're using that special tool (Ubuntu) on one of those super strong computers (EC2) far away_. This lets people do their important work or run their programs even if their own computer isn't strong enough. It's like playing your favorite game on a super strong computer somewhere else!

Launch aws portal
AWS
Search and Select EC2
Search EC2
On EC2 Dashboard, click instance
Launch EC2 instance
Give your instance a name and select the appropriate Image
Image description
Provide other parameters according to your need.
Key Pair
Create a Key Pair
Ensure that you have a key pair
Create Key Pair

Key Pair Created

To run a Nginx webserver, we need to allow HTTP traffic
Then , Launch Instance

Nginx
Connect to Instance
Ubuntu Running
Select Connect
Connect

running instance

From EC2 Portal

Access your instance locally
Launch Powershell

PowerShell

Ubuntu Login

Ubuntu
Change privilege to root
sudo su
Install Nginx with the code
apt install nginx -y
Verify Nginx is installed
nginx --version

nginx
Validate that nginx is running on webserver using Public IP
Public IP

Top comments (0)