Guides ยท Sep 27, 2026
How to Install WordPress on an Ubuntu VPS (Nginx, PHP, MariaDB)
Install WordPress on Ubuntu 24.04 with Nginx, PHP 8.3 and MariaDB, then add free HTTPS with Let's Encrypt, step by step.
This sets up a fast LEMP stack (Linux, Nginx, MariaDB, PHP) and WordPress on Ubuntu 24.04. Before you start, point your domain's A record at your server's IP address.
1. Install Nginx, MariaDB and PHP
sudo apt update
sudo apt install -y nginx mariadb-server php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-zip php-intl php-imagick
2. Create the database
sudo mysql
CREATE DATABASE wordpress;
CREATE USER 'wp'@'localhost' IDENTIFIED BY 'choose-a-strong-password';
GRANT ALL ON wordpress.* TO 'wp'@'localhost';
FLUSH PRIVILEGES;
EXIT;
3. Download WordPress
cd /var/www
sudo curl -O https://wordpress.org/latest.tar.gz
sudo tar xzf latest.tar.gz && sudo rm latest.tar.gz
sudo chown -R www-data:www-data /var/www/wordpress
4. Configure Nginx
Check your PHP version with ls /run/php/ (Ubuntu 24.04 ships PHP 8.3). Create /etc/nginx/sites-available/wordpress:
server {
listen 80;
server_name example.com www.example.com;
root /var/www/wordpress;
index index.php;
client_max_body_size 64M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
}
}
sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -t && sudo systemctl reload nginx
sudo ufw allow 'Nginx Full'
5. Add free HTTPS
sudo apt install -y certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
6. Finish in the browser
Visit your domain and follow the WordPress installer, using the database name, user and password from step 2.
Speed tips
- Install a caching plugin (for example WP Super Cache) or add Redis object caching.
- Your whole server is backed up daily; add a plugin backup too if you want off-server copies.
Need a server for this?
Every TidalVPS VPS comes with full root access, unmetered traffic, daily backups and DDoS protection.