This guide installs a production-ready WordPress on any fresh Ubuntu 22.04/24.04 VPS. If you need a VPS first, spin one up on Hostiger VPS Hosting — Basic at $15/mo is more than enough for most WordPress sites.
1. Install nginx + PHP-FPM + MySQL
apt update && apt upgrade -y
apt install nginx php-fpm php-mysql php-curl php-gd php-imagick \
php-intl php-mbstring php-xml php-zip php-bcmath mysql-server \
unzip curl -y
systemctl enable --now nginx php8.3-fpm mysql
2. Create the WordPress database
mysql -u root
CREATE DATABASE wp_site CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'STRONG_RANDOM_PASSWORD';
GRANT ALL PRIVILEGES ON wp_site.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
3. Download WordPress
cd /var/www
curl -O https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
mv wordpress example.com
chown -R www-data:www-data /var/www/example.com
rm latest.tar.gz
4. Configure nginx
Create /etc/nginx/sites-available/example.com:
server {
listen 80;
server_name example.com www.example.com;
root /var/www/example.com;
index index.php;
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; }
}
ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
5. Install free SSL with Let's Encrypt
apt install certbot python3-certbot-nginx -y
certbot --nginx -d example.com -d www.example.com --agree-tos -m [email protected] --non-interactive
Certbot auto-renews every 60 days via a systemd timer — no cron needed.
6. Complete the WordPress setup wizard
Visit https://example.com/wp-admin/install.php. Fill in database name, user and password from step 2. Choose your admin username (never "admin") and a strong password.
7. Recommended production tweaks
- Install LiteSpeed Cache or WP Rocket for full-page caching
- Set
define('DISALLOW_FILE_EDIT', true);inwp-config.php - Enable automatic security updates:
define('WP_AUTO_UPDATE_CORE', true); - Change
wp-adminlogin URL with a plugin (WPS Hide Login)
Alternative: skip the setup entirely
If you don't want to manage a VPS, Hostiger Managed WordPress from $9.99/mo comes with LiteSpeed cache, auto-updates, WebP conversion and Redis object cache pre-configured.