How to Set Up VPS Web Hosting From Scratch (2026): Complete Beginner Guide

A RackNerd VPS at $1.49/mo can host multiple WordPress sites with better performance than most $18/mo shared hosting renewals. The barrier is setup. This guide gets you from a blank server to a live WordPress site with SSL in about 30 minutes, with every command explained.

JC
Jason Chen·Lead Reviewer & Founder

Testing hosting since 2009. 60+ accounts across major providers. Former web dev turned full-time reviewer.

Updated Mar 5, 2026·12 min read𝕏LinkedIn

When I set up my first VPS it took three hours because I had to piece together commands from five different tutorials, each written for a slightly different environment. None of them explained what the commands actually did. This guide is the one I wish I had found.

This assumes Ubuntu 22.04 LTS. If your VPS runs a different OS, some commands will differ — but the structure is the same. Ubuntu 22.04 is what I recommend for beginners: it has the best documentation, the largest community, and the most consistent package versions.

What You Need Before Starting

A VPS

RackNerd ($1.49/mo), InterServer ($6/mo), or DigitalOcean ($4/mo). Minimum 1GB RAM for WordPress.

A Domain Name

You'll point your domain's A record to your VPS IP address. DNS propagation takes 5-30 minutes.

SSH Client

Terminal on Mac/Linux. PuTTY or Windows Terminal on Windows. You'll connect to your VPS over SSH.

Step 1: Buy and Access Your VPS

1a

Purchase a VPS

Sign up at RackNerd or InterServer. Choose Ubuntu 22.04 as the OS. After purchase you will receive an email with your server IP, root password, and SSH port (usually 22).

1b

Connect via SSH

Open your terminal and connect to your server:

ssh root@YOUR_SERVER_IP
1c

Update the system

First thing on any new server — update all packages:

apt update && apt upgrade -y

Step 2: Secure the Server

Never run your web server as root. The first thing to do on any VPS is create a non-root user and lock down SSH access.

2a

Create a non-root user

Create a regular user with sudo privileges:

adduser webadmin usermod -aG sudo webadmin
2b

Set up SSH key authentication

On your local machine, generate a key pair and copy it to the server:

ssh-keygen -t ed25519 ssh-copy-id webadmin@YOUR_SERVER_IP
2c

Disable root login and password auth

Edit SSH config to only allow key-based login:

sudo nano /etc/ssh/sshd_config # Set: PermitRootLogin no # Set: PasswordAuthentication no sudo systemctl restart sshd
2d

Enable firewall

Allow only SSH, HTTP, and HTTPS traffic:

sudo ufw allow OpenSSH sudo ufw allow 80 sudo ufw allow 443 sudo ufw enable

Step 3: Install LEMP Stack

LEMP = Linux + Nginx + MySQL + PHP. This is the standard stack for WordPress on a VPS. Nginx uses significantly less RAM than Apache, which matters on a 1GB server.

3a

Install Nginx

sudo apt install nginx -y sudo systemctl enable nginx
3b

Install MySQL

sudo apt install mysql-server -y sudo mysql_secure_installation
3c

Install PHP 8.2

sudo apt install php8.2-fpm php8.2-mysql php8.2-xml php8.2-mbstring php8.2-curl php8.2-zip php8.2-gd php8.2-imagick -y
3d

Create database for WordPress

sudo mysql CREATE DATABASE wordpress; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'YOUR_STRONG_PASSWORD'; GRANT ALL ON wordpress.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES; EXIT;

Step 4: Install WordPress

4a

Download and extract WordPress

cd /var/www sudo wget https://wordpress.org/latest.tar.gz sudo tar -xzf latest.tar.gz sudo chown -R www-data:www-data wordpress sudo rm latest.tar.gz
4b

Configure Nginx for WordPress

sudo nano /etc/nginx/sites-available/wordpress # Add server block with root /var/www/wordpress # Include: index index.php; # Include: try_files $uri $uri/ /index.php?$args; sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/ sudo nginx -t && sudo systemctl reload nginx
4c

Complete WordPress setup

Visit http://YOUR_DOMAIN in your browser. WordPress will guide you through the setup wizard. Enter the database name (wordpress), user (wpuser), and the password you set in Step 3d.

Step 5: SSL and Domain Setup

5a

Install Certbot (free SSL)

sudo apt install certbot python3-certbot-nginx -y
5b

Get your SSL certificate

sudo certbot --nginx -d yourdomain.com -d www.yourdomain.com
5c

Verify auto-renewal

Certbot sets up a cron job for auto-renewal. Verify it works:

sudo certbot renew --dry-run

Your site is live.

Visit https://yourdomain.com. Total time: 20-30 minutes. Total cost: $1.49-6/month for the VPS plus $10-15/year for the domain. You now have a server that outperforms most $18/mo shared hosting renewals.

Things That Trip People Up

x

Unmanaged means you handle security

Patches, firewall rules, backups — all on you. If you're not comfortable with SSH yet, start with managed hosting (Cloudways) and learn VPS management in parallel on a separate cheap VPS.

x

"Unlimited bandwidth" means shared port

Budget VPS plans often advertise 1Gbps but that is a shared port. During peak hours you might get 100Mbps actual throughput. It is still fast enough for most use cases.

x

Don't skip backups on a VPS

I lost a client's staging server because I assumed the provider had automatic snapshots. They didn't. Set up UpdraftPlus before you start using the site, not after.

x

Check the virtualization type

KVM is better than OpenVZ for isolation and kernel control. Some cheap deals are still OpenVZ. The VPS spec page should list it — if it does not say KVM, ask.

Which VPS to Use

ProviderPriceRAMBest For
RackNerd$1.49/mo1GBBudget VPS, learning, dev servers
InterServer$6/mo2GBPrice-locked, better support
DigitalOcean$4/mo512MBBest documentation for beginners
BandwagonHost$49.99/yr1GBChina-optimized routing

For following this guide: RackNerd or DigitalOcean. RackNerd is cheaper. DigitalOcean has better documentation if you get stuck — their tutorials are comprehensive and kept up to date.

See RackNerd pricing

FAQ

JC
Jason Chen·Lead Reviewer & Founder

Testing hosting since 2009. 60+ accounts across major providers. Former web dev turned full-time reviewer.

Updated Mar 5, 2026·12 min read𝕏LinkedIn

Last updated: 2026-03-09