This is part of a series on hosting a website on the Raspberry Pi. Click the Raspberry Pi Webserver in the Blog Series to the right for the complete steps.

Let’s begin with the installation of WordPress. Follow these commands to create the directory, download WordPress, extract it, move it to your directory, change ownership of the files, and then some clean up.

sudo mkdir /var/www/rodsnotes
cd /var/www
sudo wget http://wordpress.org/latest.tar.gz
sudo tar xzf latest.tar.gz
sudo mv wordpress/* rodsnotes
sudo chown -R www-data: .
sudo rm latest.tar.gz
sudo rm -d wordpress

Next we will create the databases for the WordPress installation.

sudo mysql -u root -p <your_password>

When creating the database for WordPress, you can name it whatever you want.

CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'your_password';
FLUSH PRIVILEGES;

Ctrl+D to exit the sql prompt.

That is all we need to do with databases for WordPress, now let’s move on to the next post: Configure Apache To Access WordPress.

Share this content: