📝 How to Install WordPress on VPS: Step-by-Step Guide
WordPress is the most popular CMS in the world. Installing it on your own VPS gives you full control over performance and configuration. In this guide, you’ll learn how to manually install WordPress on a VPS with Ubuntu using the LAMP or LEMP stack. Some basic Linux and console knowledge is required.
📦 Step 1. Prepare the Server
Make sure you have a VPS with Ubuntu 20.04+ and SSH access. Then update the system:
sudo apt update && sudo apt upgrade -y
⚙️ Step 2. Install LAMP or LEMP Stack
For LAMP (Apache):
sudo apt install apache2 mysql-server php php-mysql libapache2-mod-php php-cli php-curl php-xml php-mbstring unzip -y
For LEMP (Nginx):
sudo apt install nginx mysql-server php-fpm php-mysql php-cli php-curl php-xml php-mbstring unzip -y
🗄 Step 3. Create the Database
Log in to MySQL and create the database:
sudo mysql -u root -p CREATE DATABASE wordpress; CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'strongpassword'; GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
📥 Step 4. Download and Unpack WordPress
cd /var/www/ sudo wget https://wordpress.org/latest.zip sudo unzip latest.zip sudo chown -R www-data:www-data wordpress sudo chmod -R 755 wordpress
🌐 Step 5. Configure the Virtual Host
Apache:
sudo nano /etc/apache2/sites-available/wordpress.conf
Add the following content:
ServerName yourdomain.com DocumentRoot /var/www/wordpress AllowOverride All
Enable the site and restart Apache:
sudo a2ensite wordpress sudo a2enmod rewrite sudo systemctl restart apache2
🧪 Step 6. Launch the Installer in Browser
Open http://yourdomain.com
or your server's IP in a browser. Follow the WordPress installation wizard:
- 📝 Set site title
- 👤 Enter admin login and password
- 📧 Provide your email
- ✅ Click “Install WordPress”
📌 Bit.Hosting Recommendations
- 🔐 Set up an SSL certificate via Let’s Encrypt
- 📦 Regularly update plugins and WordPress core
- ⚡ Use caching (e.g., WP Super Cache)
- 🔒 Secure /wp-admin with Fail2Ban or IP restriction
- 🛠 Use a control panel (e.g., ISPmanager) for easier setup
If you're having trouble installing WordPress or want an automatic setup — contact Bit.Hosting support. We'll take care of everything for you! 🚀