Home VPS How to Install a Web Server on Your VPS (Nginx or Apache) + Test a Site

How to Install a Web Server on Your VPS (Nginx or Apache) + Test a Site

Last updated on Jan 07, 2026

Overview

This guide helps you get a basic website online on your VPS using either:

  • Nginx (recommended for most users)

  • Apache (popular and very flexible)

You’ll install the web server, open firewall ports, and test that your site is reachable.

Before you start

  • These steps are written for Ubuntu/Debian.

  • You’ll need SSH access to your VPS.

  • If you already enabled a firewall, make sure ports 80 (HTTP) and 443 (HTTPS) are allowed.


Step 1: Connect to your VPS via SSH

From your computer:

  • ssh username@YOUR_VPS_IP

Option A: Install Nginx (recommended)

Step A1: Install Nginx

  1. sudo apt update

  2. sudo apt install nginx -y

Step A2: Start and enable Nginx

  1. sudo systemctl start nginx

  2. sudo systemctl enable nginx

Step A3: Allow web traffic through the firewall (UFW)

If you use UFW:

  • sudo ufw allow 80/tcp

  • sudo ufw allow 443/tcp

Step A4: Test Nginx

On your computer, open a browser and go to:

  • http://YOUR_VPS_IP

You should see the “Welcome to nginx!” page.


Option B: Install Apache

Step B1: Install Apache

  1. sudo apt update

  2. sudo apt install apache2 -y

Step B2: Start and enable Apache

  1. sudo systemctl start apache2

  2. sudo systemctl enable apache2

Step B3: Allow web traffic through the firewall (UFW)

If you use UFW:

  • sudo ufw allow 80/tcp

  • sudo ufw allow 443/tcp

Step B4: Test Apache

On your computer, open a browser and go to:

  • http://YOUR_VPS_IP

You should see the Apache2 Ubuntu Default Page.


Step 2: Upload a simple test page

This confirms you’re serving your own content.

For Nginx (default web root)

  1. cd /var/www/html

  2. echo "<h1>It works — Q-Fi Cloud</h1>" | sudo tee index.html

Restart (optional, but safe):

  • sudo systemctl reload nginx

For Apache (default web root)

  1. cd /var/www/html

  2. echo "<h1>It works — Q-Fi Cloud</h1>" | sudo tee index.html

Restart (optional):

  • sudo systemctl reload apache2

Now refresh:

  • http://YOUR_VPS_IP

You should see your new page.


Step 3: (Optional) Point a domain to your VPS

To use a domain (example: example.com):

  1. Log into your domain DNS provider

  2. Create an A record pointing to your VPS IP

Example:

  • Host/Name: @

  • Type: A

  • Value: YOUR_VPS_IP

DNS can take a bit to update depending on TTL.


Troubleshooting

Site doesn’t load at all

  • Confirm your VPS allows inbound traffic on port 80.

  • Check firewall status:

    • sudo ufw status
  • Confirm the service is running:

    • Nginx: sudo systemctl status nginx

    • Apache: sudo systemctl status apache2

You see an old page / changes don’t show

  • Hard refresh your browser (Ctrl+F5)

  • Confirm you edited the correct file: /var/www/html/index.html

Port 80 works but domain doesn’t

  • DNS may not have propagated yet

  • Confirm the A record points to the correct IP

Need help getting your site live?

Send us:

  • Your OS (Ubuntu/Debian)

  • Nginx or Apache

  • Your domain (if using one)

  • Any error messages or screenshots

We’ll help you get it online.


📦 Powered by Q-Fi Cloud

At Q-Fi Cloud, we provide reliable, flexible, and easy-to-use hosting solutions for both gamers and businesses. Whether you’re setting up a game server, launching a business website, or running apps on a VPS, we’ve got you covered.

  • ✅ 24/7 expert support

  • ✅ Fast setup & performance-tuned servers

  • ✅ Scalable plans for communities and businesses

👉 Explore Hosting Plans