How to Install WordPress on a VPS Step by Step
Install WordPress on your VPS: with a control panel (CyberPanel, aaPanel) or manually with LAMP/LEMP. Requirements and configuration.
In this article
Introduction
Installing WordPress on a VPS is the ideal option when your website has grown and needs more resources than shared hosting offers. A VPS gives you more speed, more control and better ability to withstand traffic spikes.
You have two paths to install it: with a control panel (the easiest) or manually (more technical but with total control). In this article you’ll see both.
When WordPress on a VPS is worth it
WordPress on a VPS is worth it if:
- Your website receives many visits and shared hosting falls short.
- You have a WooCommerce store with many products or orders.
- You need total control of the server configuration.
- You want to isolate your website from other customers (on shared hosting you share a server).
- You have several websites and want to manage them yourself.
If your website is small or medium, a WordPress-optimized hosting is usually simpler and sufficient. At miHosting we offer both: professional hosting to start and a VPS for when you need more.
Method 1: Install WordPress with a control panel (recommended)
This is the simplest way. Once a panel like CyberPanel, aaPanel or cPanel is installed on your VPS, installing WordPress is a matter of clicks.
With CyberPanel
- Log in to the CyberPanel dashboard.
- Go to Websites → Create Website.
- Fill in the details: domain, email, PHP package.
- Once the site is created, go to Website → List Websites and enter the site.
- Look for the Install WordPress (one-click) option.
- Fill in the details: title, administrator username and password.
- In a few seconds you’ll have WordPress installed.
[Imagen sugerida: screenshot of one-click WordPress installation in CyberPanel]
With aaPanel
- Log in to aaPanel.
- Go to App Store and search for WordPress (WordPress Deployment).
- Click Install.
- Create the site, configure the domain and WordPress details.
- Done.
With cPanel
- Log in to cPanel.
- Find Softaculous or WordPress Manager.
- Click Install.
- Fill in the details: domain, site name, username, password.
- In less than two minutes you have WordPress running.
Panels with LiteSpeed (like CyberPanel) install WordPress with native caching, which makes it especially fast.
Method 2: Install WordPress manually
If you don’t want to use a panel or prefer total control, you can install WordPress manually over LAMP or LEMP.
Prerequisites
Before starting you need to have installed on your VPS:
- Web server (Apache or Nginx).
- PHP 8.x with the necessary extensions (curl, gd, mbstring, xml, zip, intl, mysql).
- MariaDB or MySQL.
If you don’t have it yet, check our guide on how to install LAMP or LEMP.
Step 1: Create the database
Connect to MariaDB:
mysql -u root -p
Create the database and user:
CREATE DATABASE wordpress;
CREATE USER 'wp_user'@'localhost' IDENTIFIED BY 'your_secure_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wp_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Write down these three details: database name, username and password. You’ll need them later.
Step 2: Download WordPress
Go to the web folder:
cd /var/www/html
Download the latest version of WordPress:
wget https://wordpress.org/latest.tar.gz
tar -xzf latest.tar.gz
Move the files to the appropriate directory:
cp -a wordpress/. .
rm -rf wordpress latest.tar.gz
Step 3: Configure permissions
So WordPress can upload files and update:
chown -R www-data:www-data /var/www/html
chmod -R 755 /var/www/html
Step 4: Configure WordPress
Rename the configuration file:
cd /var/www/html
cp wp-config-sample.php wp-config.php
Generate security keys (copy them):
curl -s https://api.wordpress.org/secret-key/1.1/salt/
Edit the configuration file:
nano wp-config.php
Enter your database details:
define('DB_NAME', 'wordpress');
define('DB_USER', 'wp_user');
define('DB_PASSWORD', 'your_secure_password');
define('DB_HOST', 'localhost');
And paste the security keys you generated, replacing the default ones.
Step 5: Complete the web installation
Open your domain in the browser:
http://your-domain.com
Follow the WordPress wizard:
- Choose the language.
- Enter the site title, administrator username and password.
- Click Install WordPress.
In a few seconds it will be ready.
Step 6: Activate SSL
With free Let’s Encrypt certificates:
apt install certbot python3-certbot-apache -y # for Apache
apt install certbot python3-certbot-nginx -y # for Nginx
Generate the certificate:
certbot --apache -d your-domain.com # for Apache
certbot --nginx -d your-domain.com # for Nginx
Follow the instructions. Automatic renewal included.
Useful tips
- Start with a panel if you have no experience. Installing WordPress with one click saves you from errors.
- Configure HTTPS from day one. Never leave WordPress without SSL.
- Delete the
readme.htmlandwp-config-sample.phpfiles. They aren’t necessary and expose information. - Change the table prefix. Instead of
wp_, use something likewp_myprefix_. Improves security. - Install a cache plugin. WP Super Cache, W3 Total Cache or LiteSpeed Cache greatly speed up your website.
- Back up. Before any change and periodically.
Common problems
The WordPress installation page doesn’t load
Check that the web server (Apache or Nginx) is active and that you’ve placed the files in the correct directory (/var/www/html).
Error connecting to the database
Check the wp-config.php details: database name, username, password and host. Verify that the user has privileges on the database.
I can’t upload images or files
It’s a permissions problem. Make sure www-data owns the folder:
chown -R www-data:www-data /var/www/html
WordPress is slow
Enable caching, optimize images and check that your VPS has enough RAM. WordPress with WooCommerce needs at least 2 GB of RAM.
SSL doesn’t activate
Check that the domain already points to your VPS (DNS propagation) before generating the certificate. Let’s Encrypt doesn’t work if the domain doesn’t resolve to your server.
Frequently asked questions
Is WordPress better on a VPS or on shared hosting?
It depends. For small or medium websites, WordPress-optimized hosting is simpler and sufficient. For websites with many visitors or that need total control, a VPS is better.
Can I migrate my current WordPress to the VPS?
Yes. You can migrate manually (copy files + database) or use a plugin like All-in-One WP Migration or Duplicator.
How much RAM does WordPress need on a VPS?
For a normal website, 1 GB may suffice. For WooCommerce or websites with many visitors, we recommend a minimum of 2 GB.
Do I need to know programming to install WordPress on a VPS?
If you use a panel, no. If you install manually, you need basic Linux knowledge.
Can I have several WordPress installs on the same VPS?
Yes. You can host several WordPress installs on different domains or subdomains within the same VPS, managing them with a panel or by configuring virtual hosts.
WordPress on a VPS: maximum power
Installing WordPress on a VPS gives you speed, control and the ability to grow without the limits of shared hosting. If you have no technical experience, using a panel with one-click installation is the best option. If you want total control, manual installation over LAMP or LEMP gives it to you.
If you prefer not to handle installation and configuration, at miHosting we offer managed VPS where we install WordPress, configure SSL, enable caching and maintain the server for you. You can also opt for our WordPress-optimized hosting if you don’t yet need a VPS. Open a ticket from your client panel and we’ll advise you.