Create a WordPress Site on Raspberry Pi

This tutorial is using the Raspian Wheezy OS, Jesse has a similar installation but will not be the exact same.  This is an easy tutorial on how to create a WordPress Site on Raspberry Pi. Comments? Questions? Post below!

1. Install Apache2

First we have to instal the apache2 package on our Raspberry Pi by typing the following command into the terminal:

sudo apt-get install apache2 -y


2. Test the Web Server

Apache has already put a HTML file in our web folder. We can view this page from our computer by navigating to the IP address of our Raspberry Pi from another computer on the network. To find out the Pi’s IP address, type

hostname -I

at the command line (or read more about finding your IP address) in Raspberry Pi’s documentation.

My IP address is and this is what I see when I go to it

Install WordPress on Your Raspberry Pi


3. Find Default Home Page and Remove It

This default web page is just a HTML file called ‘index.html’ located in /


. Head there now by running the command

cd /var/www/html
sudo rm -rf /var/www/html/index.html

You should see our index.html file. You can edit this file but we remove it for now because we do not need it.


4. Install PHP + Packages

Install the PHP and Apache packages with the following command:

sudo apt-get install php5 libapache2-mod-php5 -y


4. Install MySQL

Install the MySQL packages with the following command:

sudo apt-get install mysql-server php5-mysql -y

After this command is executed, you should see this screen. Enter a password for the ‘root’ user.

Install WordPress on Your Raspberry Pi SQL

After it finishes installing (takes a few minutes) then we can continue.


4. Download WordPress Files to to your Raspberry Pi

Head to the /var/www folder to download WordPress. Run these commands:

cd /var/www
sudo chown pi: .
sudo rm * wget

Extract WordPress files to the current (empty) folder.

tar xzf latest.tar.gz
mv wordpress/* .
rm -rf wordpress latest.tar.gz


5. Setup WordPress Database with MySQL

Now we will setup a database that will communicate with our WordPress instance. Run the following commands:

mysql -uroot -pYouSQLPassword

Make a database named ‘wordpress’ although you can name it whatever you’d like.

create database wordpress;

Hit enter, and then hit Ctrl-D to exit the MySQL prompt.


6. Go to IP Address of Raspberry Pi

WordPress now makes the installation extremely easy. Because we have our files in the correct www folder, have created our database, we can now head to the IP address of our Raspberry Pi to complete the installation. My IP address is This is what you should see when you navigate:

Install WordPress on Your Raspberry Pi WordPress


After you hit ‘Let’s Go!’, enter our details from above:

MySQL Setup Raspberry Pi



7. Copy wp-config File

The next screen will show you the wp-config file. Copy it to your clipboard and prepare to paste it back on your Raspberry Pi to finish installing the WordPress instance.

On your Raspberry Pi run the commands:

nano wp-config.php

Paste the contents then hit Ctrl-X to exit and save.  Then back on the front end you can hit ‘Run the Install.’


8. Enter WordPress Information

The next screen designed by WordPress will allow you to enter your site details. Enter your information and then hit install WordPress.

WordPress Installation Raspberry Pi


You now have WordPress setup on your Raspberry Pi!

Raspberry Pi WordPress

Post any questions or comments that you have below. Also be sure to check out our hardware recommendations page for cool stuff to buy for your Raspberry Pi. Please feel free to share or send this tutorial on Facebook or Twitter. Wordpress Site on Raspberry Pi | Raspberry Pi Tutorials.



5 Responses

  1. James says:

    Thanks! This was really helpfull.

  1. November 8, 2015

    […] Here’s a nice beginners’ tutorial that tells you how to install WordPress and MySQL to enable you to host a blog website on your Raspberry Pi. Read it here. […]

  2. November 12, 2015

    […] An easy tutorial on how to create a WordPress Site on Raspberry Pi in only 8 steps. Comments? Questions? Post below!  […]

  3. November 13, 2015

    […] tutorial from raspberrypituts, via […]

  4. November 22, 2015

    […] Create a WordPress Site on Raspberry Pi – [Link] […]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.