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
at the command line (or read more about finding your IP address) in Raspberry Pi’s documentation.
My IP address is 192.168.1.11 and this is what I see when I go to it
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 ls 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.
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 http://wordpress.org/latest.tar.gz
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 192.168.1.11. This is what you should see when you navigate:
After you hit ‘Let’s Go!’, enter our details from above:
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.
You now have WordPress setup on your Raspberry Pi!
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.