After buying a VPS, most new users run into the same problem: they want to build a website but have no clear idea where to start. This tutorial splits the entire WordPress deployment into seven simple, follow-along steps with every command you need. Just copy and run them, and you’ll have a fully working website live by the end.
Step 1: Create your VPS server
Sign up with Vultr, DigitalOcean, or Hostinger and deploy a server using these specs:
| Parameter | Recommended choice |
|---|---|
| CPU / Memory | 1 core / 2GB RAM (minimum) |
| Storage | 40GB SSD or more |
| Operating system | Ubuntu 22.04 LTS |
| Node location | Closest data center to your target audience |
Once created, copy down your public VPS IP address — you’ll need it for every next step.
Step 2: Connect via SSH & update system
Mac and Linux use the default terminal; Windows use PowerShell or PuTTY:
ssh root@your_server_IP
Type yes to confirm the server fingerprint, then enter your root password to log in.
First thing after login, update all system packages:
apt update && apt upgrade -y
Step 3: Install Nginx web server
Nginx is lightweight, high-performance, and perfect for running WordPress:
apt install nginx -y
systemctl enable nginx
systemctl start nginx
Now open your VPS IP in a browser. If you see the default Nginx welcome page, installation is successful.
Step 4: Install MySQL, PHP & WordPress
Install MySQL database first:
apt install mysql-server -y
mysql_secure_installation
Log into MySQL to create a database and user for WordPress:
mysql -u root -p
Run these SQL commands line by line, replace your_password with a strong password:
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Install PHP and required extensions for WordPress:
apt install php php-fpm php-mysql php-xml php-curl php-gd php-mbstring -y
Download and install WordPress into your web root folder:
cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz
chown -R www-data:www-data /var/www/html
Edit Nginx config to support PHP:
nano /etc/nginx/sites-available/default
Find the index line and edit to:
index index.php index.html index.htm;
Find the PHP location block and make it:
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
}
Save and exit nano, then restart Nginx:
systemctl restart nginx
Visit your VPS IP in browser — you should see the WordPress installation wizard ready to go.
Step 5: Point domain name to your VPS
Go to your domain registrar’s DNS panel (Cloudflare, Namecheap, Porkbun etc.), add two A records:
Type: A
Hostname: @
Value: your VPS IP
TTL: 3600
Type: A
Hostname: www
Value: your VPS IP
TTL: 3600
Wait a few minutes to a few hours for DNS to propagate. You can test with ping yourdomain.com on your local terminal.
Edit Nginx config to add your domain:
nano /etc/nginx/sites-available/default
Change server_name line to:
server_name yourdomain.com www.yourdomain.com;
Restart Nginx:
systemctl restart nginx
Step 6: Install free SSL HTTPS with Certbot
HTTPS is required for modern websites and good for SEO. Install Certbot:
apt install certbot python3-certbot-nginx -y
certbot --nginx -d yourdomain.com -d www.yourdomain.com
Follow the prompts to enter your email and agree terms. Certbot will auto-install SSL and update Nginx config.
Test automatic renewal to make sure it works:
certbot renew --dry-run
Let’s Encrypt auto-renews, no manual work needed later.
Step 7: Basic VPS security setup
Set up firewall only allowing necessary ports:
ufw allow ssh
ufw allow 80/tcp
ufw allow 443/tcp
ufw enable
ufw status
Install Fail2ban to block brute-force SSH attacks:
apt install fail2ban -y
systemctl enable fail2ban
systemctl start fail2ban
Optional: Change default SSH port to reduce scanner attacks
nano /etc/ssh/sshd_config
Uncomment and change:
Port 2222
Update firewall and restart SSH:
ufw allow 2222/tcp
ufw delete allow ssh
systemctl restart sshd
Next time connect with:
ssh -p 2222 [email protected]
Common troubleshooting tips
• Can’t open Nginx page: Check systemctl status nginx and confirm port 80 is open in UFW
• WordPress database error: Double-check database name, username, password during WP install
• Certbot SSL failure: Make sure DNS already points to your VPS IP and port 80 is open
• 2GB VPS capacity: Can run 3–5 low-traffic WordPress sites stably
Full process timeline
| Step | Action | Estimated time |
|---|---|---|
| 1 | Purchase & create VPS | 2 minutes |
| 2 | SSH login & system update | 2 minutes |
| 3 | Install Nginx | 1 minute |
| 4 | Install MySQL, PHP & WordPress | 5 minutes |
| 5 | Domain DNS setup | 2min + DNS wait |
| 6 | HTTPS SSL configuration | 2 minutes |
| 7 | Firewall & security hardening | 3 minutes |
Following these exact steps, you can go from a blank VPS to a fully secured WordPress site with HTTPS in under 20 minutes. If you hit any error, just copy the message and search it — nearly every beginner issue has a ready solution online.