Here are the steps to install WordPress on a VPS (Virtual Private Server):
1. Access Your VPS: You need to access your VPS using SSH. If you’re using Linux or MacOS, you can use the built-in Terminal program. Windows users can use a program like PuTTY.
1. Update Your Server: Before starting with the WordPress installation, it’s a good idea to make sure that your VPS is up to date. You can do this by running the following commands:
```
sudo apt-get update
sudo apt-get upgrade
```
1. Install Stack: You need to install a stack on your VPS. A “stack” includes the operating system, database, web server, and PHP. If you’re using Ubuntu, you can get the LAMP stack (Linux, Apache, MySQL, and PHP) with this command:
```
sudo apt-get install apache2 mysql-server php php-mysql libapache2-mod-php php-cli
```
1. Create a MySQL Database: WordPress needs a MySQL database to operate. Create one with these commands:
```
sudo mysql -u root -p
create database wordpress;
grant all privileges on wordpress.* to ‘wordpressuser’@‘localhost’ identified by ‘password’;
flush privileges;
exit;
```
1. Install WordPress: Now you can install WordPress with these commands:
```
cd /tmp
wget https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
sudo mv wordpress /var/www/html/wordpress
```
1. Configure WordPress: Before you can start using WordPress, you need to configure it:
```
cd /var/www/html/wordpress
sudo cp wp-config-sample.php wp-config.php
sudo nano wp-config.php
```
In the file, replace ‘database_name_here’ with the name of your database (wordpress in our example), ‘username_here’ with your MySQL username (wordpressuser in our example), and ‘password_here’ with your MySQL password.
1. Set Up Apache: Lastly, you’ll need to set up Apache to serve your WordPress site. Create a new Apache configuration file with this command:
```
sudo nano /etc/apache2/sites-available/wordpress.conf
```
In the file, add the following:
```
```
Replace ‘your-domain.com’ with your actual domain name.
1. Enable Website: Enable your website with this command:
```
sudo a2ensite wordpress.conf
```
And restart Apache to load the new configuration:
```
sudo service apache2 restart
```
Now, you can go to your domain name in your web browser and follow the steps to finalize your WordPress installation.