Want full control over your WordPress site without the limitations of shared hosting? Installing WordPress on a VPS is the way to go. In this guide, we’ll show you how to set up WordPress on a VPS using Ubuntu — step by step.


🚀 Why Install WordPress on a VPS?

A VPS gives you more power, flexibility, and performance compared to shared hosting:

  • Full root access

  • Dedicated resources

  • Custom software stack

  • Better speed and security

You can start with a free VPS from GratisVPS.net to follow this tutorial.


🛠️ What You’ll Need

  • A VPS running Ubuntu 20.04 or 22.04

  • SSH access (provided in GratisVPS Dashboard)

  • A domain name (optional but recommended)

  • Basic terminal knowledge


📦 Step 1: Connect to Your VPS via SSH

bash
ssh root@your-server-ip

Replace your-server-ip with your actual VPS IP address.


⚙️ Step 2: Update the System

bash
apt update && apt upgrade -y

🧱 Step 3: Install LAMP Stack (Linux, Apache, MySQL, PHP)

Install Apache:

bash
apt install apache2 -y

Install MySQL:

bash
apt install mysql-server -y
mysql_secure_installation

Follow the prompts to secure your MySQL installation.

Install PHP and Extensions:

bash
apt install php php-mysql libapache2-mod-php php-cli php-curl php-gd php-xml php-mbstring -y

🗃️ Step 4: Create a MySQL Database for WordPress

Log in to MySQL:

bash
mysql -u root -p

Then create a database and user:

sql
CREATE DATABASE wordpress;
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

📥 Step 5: Download WordPress

bash
cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar -xvzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz

🔧 Step 6: Configure WordPress

Rename the sample config file:

bash
cp wp-config-sample.php wp-config.php

Edit the file with your database info:

bash
nano wp-config.php

Update these lines:

php
define( 'DB_NAME', 'wordpress' );
define( 'DB_USER', 'wpuser' );
define( 'DB_PASSWORD', 'yourpassword' );

🔐 Step 7: Set Permissions and Restart Apache

bash
chown -R www-data:www-data /var/www/html/
chmod -R 755 /var/www/html/
systemctl restart apache2

🌐 Step 8: Access WordPress in Your Browser

Go to:

arduino
http://your-server-ip

You’ll see the WordPress installation screen. Follow the setup to complete your site!

If you have a domain name, point it to your VPS IP and install SSL with Let’s Encrypt (optional).


🧩 Internal Resources


✅ Final Thoughts

Installing WordPress on a VPS gives you full control and better performance compared to shared hosting. With this guide, you’re ready to build your website with confidence.

👉 Get your free VPS now and start your WordPress journey today!

Index