Install WordPress, Summary
Content Management Systems like WordPress are a fantastic way to organize and manage your web content and are widely used, so I’ll show you how to install it on your Pi.
After installing your LAMP server, login as pi, then install WordPress CMS by entering the following commands (note* the
rm * command will delete everything inside the
/var/www/html folder, so if you have any files in there, back them up to another location before performing this command):
sudo rm ./*
sudo wget http://wordpress.org/latest.tar.gz
Now we want to extract the tarball and move the files into root directory, enter the following commands:
sudo tar xzf latest.tar.gz
sudo mv wordpress/* .
sudo rm -rf wordpress latest.tar.gz
Now let’s check the current ownership and permissions on the files and folder, then change ownership to www-data user with the following commands (don’t forget the dot at the end of chown command):
sudo ls -l
sudo chown -R www-data: .
sudo ls -l
ls -l command will list all files, folders and their permissions.
Setup WordPress Database
Now we need to create a MySQL user and database for your WordPress installation via the command line, so let’s login to MySQL:
We should now be in the MySQL command line interface that shows
mysql> prompt. To create the WP database user and database, we enter the following commands (note* replace
[enter password] with your password, we’ll be using this when we setup WordPress later):
create user 'wordpress'@'localhost' identified by '[enter password]';
create database wordpress;
grant all privileges on wordpress.* to 'wordpress'@'localhost';
Your WordPress database is now setup.
Now let’s install WordPress by entering the IP address of your Pi ie.
http://192.xxx.x.xxx/ and hit Enter, you should be presented with the following screen:
Choose your language and click Continue
Review details then click the Let’s Go button
Enter database details as follows (replace the xxxx with some random characters for extra security) then click Submit:
- Database Name – wordpress
- Username – wordpress
- Password – [database password]
- Database Host – locahost
- Table Prefix – wp956_ (replace 956 with anything you wish, this is for security)
Now click Run the install button.
Enter the website name/title, an Admin username and password, an admin email address, and if you don’t want search engines to index this website, check the Discourage search engines from indexing this site check box (highly recommended for development servers) then click Install WordPress button.
You should now be inside the Admin section of your shiny new WordPress install running on your Raspberry Pi, congrats 🙂
Well that about wraps it up for this guide. If you have any issues or want to ask a question, let me know in the comments.
Reference & Related Links
- Raspberry Pi Help
- RPi Guides (official)
- RPi Forums (official)
- Raspbian/Debian Help
- Download Raspbian (official)
- Debian Documentation (official)
- Apache & WordPress Help
- Apache HTTP Server (official)
- WordPress Documentation (official)
- WordPress Forums (official)
- WordPress Themes (official)
- WordPress Plugins (official)