Install WordPress on Debian VPS

Today we will show you how to install WordPress on a Debian VPS using Apache web-server and MySQL database. WordPress is an open source CMS, often used as a blog publishing application powered by PHP and MySQL. Currently WordPress is the most popular of the blogging platforms available. Before you begin installing, please make sure you have Apache/PHP and MySQL installed on your WordPress VPS .

 

Download wordpress

wget -q -O - "http://wordpress.org/latest.tar.gz" | tar -xzf - -C /var/www --transform s/wordpress/your-wp-site.com/

The above command will download and extract the WordPress archive file in the /var/www/your-wp-site.com directory

Change permissions

chown www-data: -R /var/www/your-wp-site.com

 

Create MySQL database

mysql -u root -p
 CREATE DATABASE yourwpdb CHARACTER SET utf8 COLLATE utf8_general_ci;
 GRANT ALL PRIVILEGES ON yourwpdb.* TO yourwpuser@localhost IDENTIFIED BY 'yourwpdbpass';
 FLUSH PRIVILEGES;

 

Apache virtual host

Open/create a new file

nano /etc/apache2/sites-available/your-wp-site.com

Add the following content:

<VirtualHost *:80>
 ServerName your-wp-site.com
 ServerAlias www.your-wp-site.com
 DocumentRoot /var/www/your-wp-site.com
 DirectoryIndex index.php
 <Directory /var/www/your-wp-site.com/>
   Options FollowSymLinks
   AllowOverride All
 </Directory>
 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

The command below symbolically links your virtual host file from sites-available to the sites-enabled directory.

a2ensite your-wp-site.com

Restart Apache with the following command:

/etc/init.d/apache2 restart

Finally, open up your browser, navigate to http://your-wp-site.com and finish the installation wizard.

* This guide should work on on most Debian based systems including Ubuntu.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

1 thought on “Install WordPress on Debian VPS”

Leave a Comment