
Building Your Portfolio Experience
Loading Tariqul Islam's projects...
Loading Tariqul Islam's projects...
This guide explains how to install WordPress on an Ubuntu-based VPS with Nginx, MySQL, PHP 8.3, and Let's Encrypt SSL. Ideal for deploying on a domain like `domain-name.com`.
Hostinger VPS (Ubuntu 22.04+)
Domain (e.g. domain-name.com
)
NGINX
, php 8.3
, mysql
, certbot
, ufw
installed
ssh root@your-vps-ip
sudo apt update && sudo apt upgrade -y
# PHP and extensions
sudo apt install php8.3-fpm php8.3-mysql php8.3-cli php8.3-curl php8.3-xml php8.3-mbstring php8.3-zip php8.3-gd php8.3-soap php8.3-intl -y
# MySQL
sudo apt install mysql-server -y
# Nginx
sudo apt install nginx -y
sudo systemctl enable nginx
sudo systemctl status nginx
# Certbot
sudo apt install certbot python3-certbot-nginx -y
# Firewall
sudo ufw allow OpenSSH
sudo ufw allow 'Nginx Full'
sudo ufw enable
At your domain provider, configure A/AAAA
records:
Type | Name | Value |
---|---|---|
A | @ | VPS IPv4 |
A | www | VPS IPv4 |
AAAA | @ | VPS IPv6 |
AAAA | www | VPS IPv6 |
Note: IPv6 (AAAA
records) is optional — only add them if your VPS provider supports and assigns an IPv6 address.
sudo mysql
CREATE DATABASE wp_live DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'StrongSecurePassword';
GRANT ALL PRIVILEGES ON wp_live.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
cd /var/www/
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xvzf latest.tar.gz
sudo mv wordpress domain-name.com
sudo chown -R www-data:www-data /var/www/domain-name.com
sudo nano /etc/nginx/sites-available/domain-name.com
Paste this:
server {
listen 80;
server_name domain-name.com www.domain-name.com;
root /var/www/domain-name.com;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Enable and reload:
sudo ln -s /etc/nginx/sites-available/domain-name.com /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d domain-name.com -d www.domain-name.com
Enable auto-renewal:
sudo systemctl enable certbot.timer
sudo certbot renew --dry-run
Visit your domain:
https://domain-name.com
Fill in:
Database Name: wp_live
DB Username: wp_user
DB Password: StrongSecurePassword
Table Prefix: wp_
or your own
Then:
Set Site Title, Admin Email, Password
Click Install WordPress
sudo chown -R www-data:www-data /var/www/domain-name.com
sudo find /var/www/domain-name.com/ -type d -exec chmod 755 {} \;
sudo find /var/www/domain-name.com/ -type f -exec chmod 644 {} \;
Purpose | Plugin |
---|---|
SEO | Yoast SEO |
Security | Wordfence |
Backup | UpdraftPlus |
Cache Speed | LiteSpeed Cache |
Forms | Fluent Forms |
E-Commerce | WooCommerce |
WordPress site running on:
Ubuntu + NGINX + PHP 8.3
HTTPS secured via Certbot
MySQL-backed dynamic content
Ready for scaling
WordPress on https://domain-name.com
Production-ready and secure with full root control