DEV Community

salakoNBA
salakoNBA

Posted on

Setting Up NGINX on a Google Cloud Ubuntu Server: A DevOps Stage 0 Experience

As part of my DevOps journey, I set up an NGINX web server on a Google Cloud Ubuntu VM. Here's a quick rundown of the process:
Steps Taken

Creating the VM:
I launched a VM on Google Cloud Platform (GCP), naming it devops-stage-0. I chose the e2-micro machine type and Ubuntu 22.04 LTS as the operating system.

Server Setup:
After launching the VM, I connected via SSH and updated the server with:
Enter fullscreen mode Exit fullscreen mode
sudo apt update && sudo apt upgrade -y
Enter fullscreen mode Exit fullscreen mode

Installing NGINX:
I installed NGINX using:

sudo apt install nginx -y
Enter fullscreen mode Exit fullscreen mode

Then, I started and enabled the NGINX service:

sudo systemctl start nginx
sudo systemctl enable nginx
Enter fullscreen mode Exit fullscreen mode

Custom HTML Page:
I created a custom HTML page to display the message: "Welcome to DevOps Stage 0 - Salako Abdullah/salakonba".

Firewall Configuration:
To allow HTTP traffic, I configured the firewall:

sudo ufw allow 'Nginx HTTP'
    sudo ufw enable
Enter fullscreen mode Exit fullscreen mode
Testing the Setup:
After completing the configuration, I accessed the server’s External IP in the browser. The custom HTML page loaded successfully, displaying my welcome message.
Enter fullscreen mode Exit fullscreen mode

Challenges and Solutions

The main challenge was ensuring the firewall allowed HTTP traffic. Once I adjusted the rules, the page loaded correctly. Working in the cloud environment also required me to adapt, but the process was straightforward with the help of GCP’s documentation.
Learning and Growth

This task has solidified my understanding of cloud infrastructure and web server management. It was a valuable experience that boosted my confidence in working with cloud platforms and NGINX.

Reference Links

DevOps Engineers
Cloud Engineers
Site Reliability Engineers

Top comments (0)