Installing Joomla on a Raspberry Pi

From Joomla! Documentation

Note: Work-in-progress. This document is not yet ready & fully tested. Please wait with translation until it is finished. Thanks!

The Raspberry Pi is a small single-board computer that was originally developed to promote the teaching of basic computer science in schools and developing countries. Because of its versatility it has become very popular and is used as media player, small stand-alone server, etc. You can use it as webserver and install Joomla! on it. This page shows you how to get a your Joomla! website running on the Raspberry Pi.

Hardware

Rasberry Pi version 3 Model B - There are various models of Raspberry Pi. You can use most models that have an Ethernet port (the Model B types). However for performance we will use the latest version with most RAM memory.

5 Volt adapter (1 Amp) - to power the Raspberry Pi you'll need to convert the mains power (230V or 110V) to 5 Volt. The Rasperry Pi needs about 1 Amp, and maybe more if you connect USB devices to it.

standard Ethernet cable - to connect the RPi to your Local Area Network / router / the internet.

Installing Operating System

The operating system Raspbian is a Debian Linux version specially compiled for the Raspberry Pi. There are two versions of Raspbian available: Raspbian Jessie with Pixel Lite (version with PIXEL desktop based on Debian Jessie) and Raspbian Jessie Lite (minimal version based on Debian Jessie). Because we use the Raspberry Pi as webserver for Joomla, we won't need the GUI.

Now we need to copy the .img file to the (micro) SD card. You can use a tool with graphical interface like UNetbootin (for Windows, Mac OS X and Linux) or do it on the command line).

Be very careful when writing the .img disk image to another disk. In case you use the wrong destination disk, you will overwrite that disk with the .img which makes that disk unusable, resulting in data loss.

Windows

In a terminal (CMD) check which device corresponds with the SD Card and do something like:

Linux

We connect a SD Card reader with the (micro) SD Card to a computer. With dmesg we can find the device name of the SD Card. In our case dmesg shows something like

[xxxxxx.xxxxxxx] sdd: sdd1 sdd2

meaning that we have a SD Card with 2 partitions. Do not write the Raspbian image to a partition but to the whole disk sdd.

We will use dd ("Disk Dump") to write an Input File (if) to an Output File (of) using a specified Block Size (bs).

Be VERY careful: dd will write to a device without any warning. Triple double check that that you write to the right device! If you write to the wrong disk, then you'll always remember the dd command as "Disk Destroyer".

The authenticity of host '192.168.0.35 (192.168.0.35)' can't be established.
ECDSA key fingerprint is 42:42:42:42:42:42:42:42:42:42:42:42:42:42:42:42.
Are you sure you want to continue connecting (yes/no)?

We'll choose "Yes"

Warning: Permanently added '192.168.0.35' (ECDSA) to the list of known hosts.
pi@192.168.0.35's password:

and use the default password: raspberry which on successful login will show:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
pi@raspberrypi:~ $

We can configure the Raspberry Pi using a text interface via:

sudo raspi-config

Raspberry Pi Software Configuration Tool (raspi-config)

With this configuration tool we'll only change the following settings.

1 Expand Filesystem

By default the disk space on the SD Card is the same size as the 1.4GB .img file that you used to create the SD card for your Raspberry Pi. You can use this option to gain the rest of the disk space.

2 Change User Password

For security reasons it's best to change the default password "raspberry" as soon as possible.

You can check the installation with a browser. Go to the IP address of your Raspberry pi, in our case http://192.168.0.35/ We should see a message like:

Welcome to nginx on Debian!
If you see this page, the nginx web server is successfully installed and working on Debian. Further configuration is required.
For online documentation and support please refer to nginx.org
Please use the reportbug tool to report bugs in the nginx package with Debian.
However, check existing bug reports before reporting a new bug.
Thank you for using debian and nginx.

Starting and stopping Nginx

After installation Nginx will automatically be started. You can:

Stop Nginx: sudo service nginx stop

Start Nginx: sudo service nginx start

Restart Nginx: sudo service nginx restart

Configure Nginx

Global Nginx configuration

In the global configuration of Nginx we can configure default caching etc. The Raspberry Pi 3 uses 1.2 GHz 64-bit quad-core ARM Cortex-A53 processor. If you have an earlier version with less CPU cores, then you should use

sudo nano /etc/nginx/nginx.conf

to change the "worker_processes" to fit the amount of CPUs of your device. By default it's configured as

worker_processes 4;

so for Raspberry Pi 3 you don't have to change it.

After changing the Nginx configuration or virtual domain configuration, you have to do a

sudonginxreload

to make the changes effective.

Virtual Domains

It's possible to run multiple Joomla websites on the same server using virtual domains.

Put every website in a separate folder in the default webroot /var/www/ for example:

/var/www/example.com/

/var/www/voorbeeld.nl/

sudo mkdir /var/www/example.com
sudo mkdir /var/www/voorbeeld.nl

For every site we will create a virtual domain which is basically a text file with domain specific information:

Database

We can install MariaDB or MySQL; Joomla will work with both. Let's install MariaDB with:

sudo apt-get install mariadb-server

During the installation you've to add a password for the root user. Lets create a database password, for example correcthorsebatterystaple.

Finally let's improve the security of our MariaDB installation by removing root accounts that are accessible from outside the local host, anonymous-user accounts and the test database. We can do that with

mysql_secure_installation

PHP

For PHP we will install the php-fpm (FastCGI Process Manager) that runs as a daemon and receives Fast/CGI requests. Furthermore we will install php5-mysql which is a module for MySQL database connections directly from PHP scripts.

more recent php7 should be installed with

sudo apt-get install php-fpm php-mysql

Now we need to let Nginx know that it should use php-fpm for .php files. We add a couple of lines to our virtual domains:

Joomla!

Connecting Raspberry Pi to Internet

We want people on the internet to be able to visit our Joomla website on our Raspberry Pi. In order to do that we need to configure our Internet router to forward all incoming traffic on port 80 to our Raspberry Pi.

Use your web browser to connect to the Web Interface of your router. A router is usually located on the first number of your IP range, in our case on 192.168.0.1. In our router we configure Port Forwarding:

External IP Address: 0.0.0.0

External Start Port: 80

External End Port: 80

Internal IP Address: 192.168.0.35 ( = our Raspberry Pi)

Internal Start Port: 80

Internal End Port: 80

Protocol: TCP

Make sure that it is enabled.

If everything is working correctly then you should see your own Joomla website on the Raspberry Pi by visiting your external IP address (Find your external IP address with a tool like whatsmyip.org).

Using a domain name

Let's assume that our external IP address is 42.42.42.42. Let's also assume that we have registered a domain name called example.com. We would like to serve our Joomla site on our Raspberry Pi to visitors visiting example.com. If your domain name registrar gives us the possibility to configure the Domain Name System (DNS) server, then we'll need to create an MX record in the DNS that points our domain name to our IP address 42.42.42.42. Note that it can take up to 24 hours till all internet providers will redirect the traffic of their customers to the configured MX record.

Static IP address

Most routers will keep assigning the same internal IP address to your Raspberry Pi. Sometimes it's better to configure your Raspberry Pi to use a static IP address:

Content is available under Joomla! EDL unless otherwise noted.Joomla!® is a registered trademark of Open Source Matters, Inc.If you are experiencing technical issues with this website, please report it
.
Notice a content problem? Create an account
and fix it.