Recently, while building a brand-new WordPress content management system for an enterprise client, I organized the essential steps and troubleshooting nuances into these study notes for anyone looking to deploy websites on their own cloud server.

The hosting infrastructure chosen for this project is a VPS (Virtual Private Server) hosted on the renowned provider Bluehost.


1. Pre-installation Evaluation: Do You Really Need to Build a VPS from Scratch?

Before typing your first Linux command, pause and objectively evaluate your system maintenance capabilities and time commitments.

A VPS partitions dedicated, isolated computing resources (individual CPU cores, RAM, and SSD storage) within a physical server through virtualization technology. Unlike traditional “shared hosting”, where noisy neighbors on the same server can slow your site down, a VPS grants high performance autonomy and guaranteed bandwidth.

However, the trade-off is: you must handle the software environment entirely by yourself. From selecting a Linux distribution (Ubuntu or CentOS are recommended for their mature ecosystems), installing web servers, and fine-tuning databases, to ongoing firewall maintenance and security patching, everything rests on your shoulders.

Webmaster Tip: If you prefer not to touch raw terminal commands but still desire superior performance beyond standard shared hosting, Vedfolnir strongly recommends Bluehost’s WordPress Hosting (Managed Hosting). The underlying hardware matches a VPS, but the provider pre-configures OS optimization, PHP caching, and security defenses—saving both time and hassle.

If you enjoy granular system control and want to master how web infrastructure works under the hood, follow the steps below to craft your WordPress server from scratch!

Linux server control panel and WebGUI management interface


2. Prerequisites: Ensure the LAMP Stack Is Ready

Before installing WordPress, your VPS must already have a working LAMP (Linux, Apache, MySQL, PHP) web environment. If you have not set it up yet, check our dedicated guide first:


3. Create a Dedicated MySQL Database and User

Connect to your VPS terminal via SSH and run the following command to log into the MySQL management prompt:

mysql -u root -p

Enter your MySQL root password to access the mysql> prompt. Then run the following SQL statements sequentially to create a dedicated database and user (replace the example database name and password with your own secure credentials):

-- 1. Create a new database named my_wpdb
CREATE DATABASE my_wpdb DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- 2. Create a new user my_wpuser with a strong password
CREATE USER 'my_wpuser'@'localhost' IDENTIFIED BY 'Your_Very_Strong_Password_123!';

-- 3. Grant all privileges on the database to this user
GRANT ALL PRIVILEGES ON my_wpdb.* TO 'my_wpuser'@'localhost';

-- 4. Flush privilege cache and exit
FLUSH PRIVILEGES;
EXIT;

Critical Security Note: Never base passwords on birthdays or simple alphanumeric patterns. Combine symbols, uppercase letters, lowercase letters, and numbers. For reference, read: Information Security: Designing Strong Passwords to Protect Online Privacy and Security.


4. Download and Extract the WordPress Core Files

Next, navigate to the server’s temporary directory and download the latest WordPress core archive from the official site:

cd /tmp
wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz

After extraction, a directory named wordpress will appear. Copy all its contents to your Apache web document root (assuming /var/www/html):

sudo cp -a /tmp/wordpress/. /var/www/html/

5. Configure Directory Permissions and wp-config.php

This is the step where beginners frequently stumble, leading to issues later like “cannot upload media” or “unable to automatically install plugins.”

1. Assign Proper File Ownership and Permissions

On Ubuntu / Debian systems, Apache runs under the user www-data; on CentOS, it runs under apache:

# Example for Ubuntu / Debian
sudo chown -R www-data:www-data /var/www/html/
sudo find /var/www/html/ -type d -exec chmod 755 {} \;
sudo find /var/www/html/ -type f -exec chmod 644 {} \;

2. Configure Database Connection Settings

Copy the sample configuration file:

cd /var/www/html/
sudo cp wp-config-sample.php wp-config.php
sudo nano wp-config.php

Locate the following constant definitions in the editor and enter the MySQL database credentials you configured earlier:

define( 'DB_NAME', 'my_wpdb' );
define( 'DB_USER', 'my_wpuser' );
define( 'DB_PASSWORD', 'Your_Very_Strong_Password_123!' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8mb4' );
define( 'DB_COLLATE', '' );

At the same time, visit WordPress’s official Secret Key API to generate a brand-new set of unique security keys and salts. Copy and replace the corresponding section in wp-config.php to strengthen session and cookie anti-tampering protection.

To ensure WordPress’s pretty permalinks function properly, verify that the Apache rewrite module is enabled:

sudo a2enmod rewrite
sudo systemctl restart apache2

6. Complete the 5-Minute Web-Based Installation

After completing the server-side configuration above, open your web browser and enter your VPS server IP address or pointed domain name (e.g. http://yourdomain.com).

The famous WordPress welcome installation screen will appear:

  1. Select Language: Choose your desired language.
  2. Enter Site Title: Enter your brand or website name.
  3. Configure Admin Account and Password: Strongly advise against using the default admin; customize a unique administrative username and securely save the strong password and email address.
  4. Search Engine Visibility: If the site is still under construction, check “Discourage search engines from indexing this site”, which can be toggled off in settings once ready.
  5. Click “Install WordPress”!

Within a few seconds, installation completes smoothly. Click log in to enter your new WordPress admin dashboard and start creating content and customizing your site!

✦ Independent Journalism · Reader Support ✦

Support Independent Perspectives & In-Depth Insights

Every thoughtful analysis and candid critique comes from our dedication to truth and quality. We choose not to follow sensational algorithms or clickbait headlines.

Sustaining independent research requires reader support. Make a one-time or monthly contribution, securely processed by Google.

Payments secured by Google · Manage or cancel anytime in your Google Account