DEV Community

Cover image for Deploy a Simple Web Server Using Nginx
Abisha Berci J
Abisha Berci J

Posted on

Deploy a Simple Web Server Using Nginx

Introduction
Nginx (pronounced Engine-X) is a high-performance open-source web server used to host websites and web applications. It is widely used because of its speed, reliability, scalability, and low memory usage. Nginx can also function as a reverse proxy server, load balancer, and HTTP cache.
In this , Ubuntu was accessed through WSL on Windows, Nginx was installed, the web server was started, and its successful deployment was verified using a web browser.

Objective
The objective is to install, configure, and deploy a simple web server using Nginx on an Ubuntu Linux environment running through Windows Subsystem for Linux (WSL). The web server is then verified by accessing it through a web browser.

Procedure:
Step 1: Open Ubuntu through WSL
Open Windows PowerShell and launch Ubuntu using the command:
wsl -d Ubuntu
Ubuntu starts successfully and provides a Linux terminal.
Step 2: Update the Ubuntu Package Repository
Update the package list using the following command:
sudo apt update
This downloads the latest package information from the Ubuntu repositories.
Step 3: Install Nginx
Install the Nginx web server using:
sudo apt install nginx -y
The installation completes successfully.
Step 4: Verify Nginx Installation
Check the installed version:
nginx -v
Output:
nginx version: nginx/1.28.3 (Ubuntu)
This confirms that Nginx has been installed successfully.
Step 5: Start the Nginx Service
Start the web server:
sudo service nginx start
This command starts the Nginx service.
Step 6: Check the Nginx Status
Verify whether the service is running:
sudo service nginx status
Output:
Active: active (running)
This indicates that the Nginx server is running successfully.
Step 7: Verify the Web Server
Open a web browser and enter:
http://localhost
The browser displays the Welcome to nginx! page, confirming that the web server is successfully deployed and accessible.

Result:
The Nginx web server was successfully installed, configured, and deployed on Ubuntu using Windows Subsystem for Linux (WSL). The server was started successfully, its status was verified as active (running), and the default Nginx web page was accessed successfully through http://localhost, confirming the successful deployment of the web server.

Top comments (0)