How to Install WordPress on a VPS
Introduction
Installing WordPress on your own VPS gives you full control, better performance, and more flexibility than shared hosting. This guide walks you through the process step by step.
Step-by-step Guide
- Update your system and install required packages
- Create a MySQL database and user for WordPress
- sudo mysql -u root -pn
- Inside the MySQL shell, run:n
- CREATE DATABASE wordpress;
- CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'your_password';
- GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
- FLUSH PRIVILEGES;
- EXIT;
- Inside the MySQL shell, run:n
- sudo mysql -u root -pn
- Download and extract WordPress
- cd /tmp
- wget https://wordpress.org/latest.zip
- unzip latest.zip
- sudo mv wordpress /var/www/html/
- sudo chown -R www-data:www-data /var/www/html/wordpress
- sudo chmod -R 755 /var/www/html/wordpress
- Configure Apache for WordPress
- sudo nano /etc/apache2/sites-available/wordpress.confn
- Add the following configuration: n
<VirtualHost *.80>- ServerAdmin admin@your_domain.com
- DocumentRoot /var/www/html/wordpress
- ServerName your_domain.com
- <Directory /var/www/html/wordpress>
- AllowOverride All
- </Directory>
- ErrorLog ${APACHE_LOG_DIR}/error.log
- CustomLog ${APACHE_LOG_DIR}access.log combined
- </VirtualHost>
- Enable the site and rewrite module, then reload Apache:n
- sudo a2ensite wordpress.conf
- sudo a2enmod rewrite
- sudo systemctl reload apache2
- Add the following configuration: n
- sudo nano /etc/apache2/sites-available/wordpress.confn
- Complete the WordPress installation via web browser
- Visit
http://your_domain.comor your server’s IP. - Follow the on-screen instructions: enter the database name, user, and password you created.
- Set your site title, admin user, and password.
- Visit
Recommendations
- Always use strong passwords for your database and WordPress admin.
- Keep WordPress and all plugins/themes updated.
- Consider setting up SSL (Let’s Encrypt) for secure access.
Call To Action
Ready to launch your own WordPress site? Get a high-performance VPS now! https://xernode.com/#pricing