Install WordPress on your VPS
Updated 27 Nov 2026 php wordpress
Set up WordPress with a web server, PHP and a database.
Read this first: a public WordPress site needs visitors to reach ports 80 and 443. A server with a dedicated IPv4 address has them. On a shared-IPv4 server use Cloudflare Tunnel.
Prepare
Install PHP with Nginx and MariaDB, and create a database and user.
sudo apt install -y php-mysql php-gd php-zip php-intl
Download
cd /tmp
curl -LO https://wordpress.org/latest.tar.gz
sudo tar -xzf latest.tar.gz -C /var/www
sudo chown -R www-data:www-data /var/www/wordpress
Use /var/www/wordpress as the Nginx root, then open the site and complete the installer.
Harden
- Strong administrator password and two-factor sign-in plugin
- Update WordPress, themes and plugins promptly; delete unused ones
- Deny execution of PHP inside
wp-content/uploads
location ~* /wp-content/uploads/.*\.php$ { deny all; }
Place that block before the general PHP block.
Direct SMTP is blocked. Use a mail provider's HTTPS API plugin.