nstalling WordPress on a VPS gives you maximum flexibility. Unlike shared hosting, there is no one-click installer by default—you will set up the environment manually. This guide assumes you have a LAMP (Linux, Apache, MySQL, PHP) stack installed.
Step 1: Create a Database
-
Log into MySQL:
mysql -u root -p -
Run these commands (replace
wpuserandpasswordwith your own):CREATE DATABASE wpdatabase; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strong_password'; GRANT ALL PRIVILEGES ON wpdatabase.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
Step 2: Download WordPress
-
Navigate to your web directory (usually
/var/www/htmlor/var/www/yourdomain.com).cd /var/www/html -
Download the latest WordPress:
wget https://wordpress.org/latest.tar.gz -
Extract it:
tar -xzvf latest.tar.gz -
Move files to the root (optional):
mv wordpress/* . /
Step 3: Configure WordPress
-
Rename the sample config file:
cp wp-config-sample.php wp-config.php -
Edit the config file:
nano wp-config.php -
Enter your database name, username, and password in the appropriate fields.
-
Save the file and exit.
-
Set proper permissions (your web server user, usually
www-dataorapache, needs write access to some folders).
Step 4: Run the Installer
Visit your domain or IP address in a web browser and follow the famous 5-minute WordPress installation.