Tools
Tools: How to Host a Website on an Ubuntu VM Using VMware and Nginx and get unstuck if it doesn't load (Step-by-Step Guide)
2026-02-08
0 views
admin
🧪 Ubuntu VM Web Server Lab (VMware + SSH + Nginx) ## 🧰 Tech Stack ## 🎯 Why I installed Nginx ## 🛠 Setup Overview ## 1️⃣ Connect to Ubuntu VM via SSH (from PowerShell) ## 2️⃣ Install and start Nginx on Ubuntu ## 3️⃣ Find the VM’s IP address ## 4️⃣ Try accessing from Windows browser ## 5️⃣ Check Ubuntu firewall (UFW) ## 🔧 Fix: Allow HTTP (port 80) ## 6️⃣ Confirm Nginx was not the problem ## 7️⃣ Verify VMware network mode ## 8️⃣ Fix VMware NAT networking (host-side issue) ## 9️⃣ Test again from Windows ## 🧠 Root Cause Summary ## 🔍 Troubleshooting Commands Used ## 💡 What this taught me (real-world skills) A hands-on lab to learn Linux web servers, networking, firewall rules, and real-world troubleshooting (plus how these skills transfer to AWS EC2 and DevOps). I installed Nginx to: Practice hosting a web service on a Linux server Test networking between Windows (host) and Ubuntu VM (guest) Learn real-world troubleshooting: firewall, ports, VM networking Build skills that directly transfer to AWS EC2 and DevOps work VM: Ubuntu on VMware Workstation Access method: SSH from PowerShell Goal: Access a web page on the VM from Windows browser Verify Nginx is running: Test locally on the VM: ✅ This confirmed Nginx was working inside the VM. ❌ Issue: Page kept loading / timed out
Error: Port 22 (SSH) allowed Ports 3000, 5000, 8000 allowed ❌ Port 80 NOT allowed Tried browser again ❌
Still timing out → meaning firewall wasn’t the only issue. curl localhost: ✅ works App layer is fine. Problem is networking between Windows ↔ VM. VMware → VM Settings → Network Adapter Mode: ✅ NAT (already selected) So NAT wasn’t misconfigured, but NAT services might be broken. ✅ VMware DHCP Service This fixed the broken network path between Windows and the VM. ✅ Nginx page loaded successfully
Problem solved 🎉 How web servers work on Linux How ports and firewalls affect access How VM networking (NAT) works How to isolate problems by layer: This is exactly the same thinking I'll use when: An EC2 instance won’t load A Docker container isn’t reachable A service times out in production Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse COMMAND_BLOCK:
ssh alok@<VM_IP> Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
ssh alok@<VM_IP> COMMAND_BLOCK:
ssh alok@<VM_IP> COMMAND_BLOCK:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx COMMAND_BLOCK:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx COMMAND_BLOCK:
sudo systemctl status nginx Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
sudo systemctl status nginx COMMAND_BLOCK:
sudo systemctl status nginx COMMAND_BLOCK:
curl http://localhost Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
curl http://localhost COMMAND_BLOCK:
curl http://localhost CODE_BLOCK:
hostname -I Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
hostname -I CODE_BLOCK:
hostname -I CODE_BLOCK:
192.168.80.129 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
192.168.80.129 CODE_BLOCK:
192.168.80.129 CODE_BLOCK:
http://192.168.80.129 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
http://192.168.80.129 CODE_BLOCK:
http://192.168.80.129 CODE_BLOCK:
ERR_CONNECTION_TIMED_OUT Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
ERR_CONNECTION_TIMED_OUT CODE_BLOCK:
ERR_CONNECTION_TIMED_OUT COMMAND_BLOCK:
sudo ufw status Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
sudo ufw status COMMAND_BLOCK:
sudo ufw status COMMAND_BLOCK:
sudo ufw allow 80/tcp
sudo ufw reload Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
sudo ufw allow 80/tcp
sudo ufw reload COMMAND_BLOCK:
sudo ufw allow 80/tcp
sudo ufw reload COMMAND_BLOCK:
sudo systemctl status nginx
curl http://localhost Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
sudo systemctl status nginx
curl http://localhost COMMAND_BLOCK:
sudo systemctl status nginx
curl http://localhost CODE_BLOCK:
services.msc Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
services.msc CODE_BLOCK:
services.msc CODE_BLOCK:
http://192.168.80.129 Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
http://192.168.80.129 CODE_BLOCK:
http://192.168.80.129 COMMAND_BLOCK:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
curl http://localhost
hostname -I
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw reload Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
curl http://localhost
hostname -I
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw reload COMMAND_BLOCK:
sudo apt update
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
curl http://localhost
hostname -I
sudo ufw status
sudo ufw allow 80/tcp
sudo ufw reload COMMAND_BLOCK:
ssh alok@<VM_IP>
ping <VM_IP> Enter fullscreen mode Exit fullscreen mode COMMAND_BLOCK:
ssh alok@<VM_IP>
ping <VM_IP> COMMAND_BLOCK:
ssh alok@<VM_IP>
ping <VM_IP> - Windows 10/11 (Host OS)
- Ubuntu Linux (Guest VM)
- VMware Workstation
- Nginx Web Server
- SSH (from PowerShell) - Practice hosting a web service on a Linux server
- Test networking between Windows (host) and Ubuntu VM (guest)
- Learn real-world troubleshooting: firewall, ports, VM networking
- Build skills that directly transfer to AWS EC2 and DevOps work - Host OS: Windows
- VM: Ubuntu on VMware Workstation
- Access method: SSH from PowerShell
- Goal: Access a web page on the VM from Windows browser - Port 22 (SSH) allowed
- Ports 3000, 5000, 8000 allowed
- ❌ Port 80 NOT allowed - Nginx: ✅ running
- curl localhost: ✅ works - VMware → VM Settings → Network Adapter
- Mode: ✅ NAT (already selected) - Press Win + R - ✅ VMware NAT Service
- ✅ VMware DHCP Service - services.msc Restart VMware NAT Service Restart VMware DHCP Service
- Restart VMware NAT Service
- Restart VMware DHCP Service - Restart VMware NAT Service
- Restart VMware DHCP Service - How web servers work on Linux
- How ports and firewalls affect access
- How VM networking (NAT) works
- How to isolate problems by layer: App
Firewall
Network
Host services
- Host services - Host services - An EC2 instance won’t load
- A Docker container isn’t reachable
- A service times out in production
how-totutorialguidedev.toailinuxubuntuservershellnetworknetworkingdhcpfirewallnginxdocker