Setting Up NGINX on Ubuntu: My First Step into DevOps
Introduction
As a software engineer with over six years of experience specializing in backend development and system architecture, I’ve always been deeply involved in designing scalable platforms, building APIs, and ensuring efficient system performance. However, as I continue to grow in my career, I recognize the increasing importance of DevOps practices in building resilient and automated deployment pipelines.
To get hands-on experience, I recently set up and configured NGINX on a fresh Ubuntu server. This exercise gave me valuable insights into web server configurations, Linux-based deployments, and the fundamentals of handling traffic routing. In this post, I’ll walk through my approach, the challenges I faced, and how this experience aligns with my professional goals.
My Approach to Completing the Task
The goal was to install NGINX, configure it to serve a custom HTML page, and ensure the web server was running correctly. Here’s the structured approach I took:
Installing NGINX
Since I was using WSL (Windows Subsystem for Linux), I started by updating my package lists and installing NGINX:
sudo apt update
sudo apt install nginx -y
Start the NGINX Manually
sudo systemctl start nginx
Verify that NGINX is running
sudo systemctl status nginx
Configuring NGINX to Serve a Custom HTML Page
By default, NGINX serves content from /var/www/html/index.html
. I edited this file to create a personalized landing page:
sudo nano /var/www/html/index.html
I added the following HTML content:
I then restarted NGINX to apply the changes:
sudo systemctl restart nginx
To confirm that my server was properly configured, I accessed it through my browser by navigating to http://localhost
or using my WSL IP address.
Challenges Faced and How I Overcame Them
Ensuring NGINX Restarts on System Boot
By default, NGINX does not restart automatically when WSL is restarted. I enabled it with:
sudo systemctl enable nginx
Permission Issues When Editing HTML Files
I initially faced permission errors while modifying files in
/var/www/html/
. To fix this, I changed ownership of the directory to my user:sudo chown -R $USER:$USER /var/www/html
How This Task Contributes to My Learning and Professional Goals
This hands-on exercise reinforced my understanding of NGINX, server configurations, and system administration. Here’s how it aligns with my career growth:
Bridging the Gap Between Development & Operations – As a backend engineer, I usually interact with APIs, databases, and microservices, but rarely with actual server deployments. This task gave me exposure to real-world web server management.
Deepening My DevOps Knowledge – By working with NGINX, I gained a better grasp of reverse proxies, static file serving, and basic server security practices, which are crucial for deploying scalable applications.
Conclusion
Setting up and configuring NGINX was a rewarding experience that introduced me to essential DevOps concepts. It’s a small but significant step towards mastering CI/CD pipelines, infrastructure automation, and cloud deployments.
Next, I plan to explore Dockerizing NGINX, setting up reverse proxies for microservices, and integrating Let’s Encrypt SSL certificates for secure web traffic.
For anyone new to DevOps, I highly recommend starting with basic server configurations like this. It’s a practical way to bridge the gap between development and infrastructure management.
References
following links in your blog:
• DevOps Engineers - https://hng.tech/hire/devops-engineers
• Cloud Engineers - https://hng.tech/hire/cloud-engineers
• Site Reliability Engineers - https://hng.tech/hire/site-reliability-engineers
• Platform Engineers - https://hng.tech/hire/platform-engineers
• Infrastructure Engineers - https://hng.tech/hire/infrastructure-engineers
• Kubernetes Specialists - https://hng.tech/hire/kubernetes-specialists
• AWS Solutions Architects - https://hng.tech/hire/aws-solutions-architects
• Azure DevOps Engineers - https://hng.tech/hire/azure-devops-engineers
• Google Cloud Engineers - https://hng.tech/hire/google-cloud-engineers
• CI/CD Pipeline Engineers - https://hng.tech/hire/ci-cd-pipeline-engineers
• Monitoring/Observability Engineers - https://hng.tech/hire/monitoring-observability-engineers
• Automation Engineers - https://hng.tech/hire/automation-engineers
• Docker Specialists - https://hng.tech/hire/docker-specialists
• Linux Developers - https://hng.tech/hire/linux-developers
• PostgreSQL Developers - https://hng.tech/hire/postgresql-developers