Raspberry Pi Drupal Installation: Make a Raspberry Pi Web Server With Drupal

The Raspberry Pi is a versatile single-board computer. Its popularity stems from massive operating system support, community resources, and a bevy of applications. Though it often seems as though the majority of users are running RetroPie, Recalbox, or Lakka on the Raspberry Pi for retro gaming, it's a capable device for tons of applications. You can create a media or file server with a Raspberry Pi for file access virtually anywhere. Additionally, you can make your own Raspberry web server with Drupal. Learn how to install Drupal on Raspberry Pi boards!

Drupal on Raspberry Pi: What is Drupal?

Drupal is a free and open-source content management system (CMS). It's written in PHP and available freely and legally under the GNU General Public License. Because of its open-source nature, hefty feature set, and lots of community support, Drupal is a popular content management framework. It's touted as both highly-scalable and flexible. Like WordPress, Drupal boasts tons of resources including themes, forums, and more. Notably, Drupal features excellent security features, with sites such as WhiteHouse.gov using Drupal

Raspberry Pi Drupal Server Installation: What You'll Need 

First, you'll need a Raspberry Pi board. A Raspberry Pi 2, Raspberry Pi 3, or Raspberry Pi 3 B+ will suffice but the Raspberry Pi 4 works best. Additionally, a Raspberry Pi Drupal install requires a power supply, microSD card, a Linux-based operating system (OS), and optional case. Plus, peripherals such as a keyboard and mouse. A Raspberry Pi runs about $35 for just the board. There are tons of neat Raspberry Pi cases you can buy for protecting your Pi board. Chances are you likely have a microSD card lying around and probably a compatible micro USB cable to use as a power supply. You can pick up a complete kit for around $40 or more.

Total cost: $35+

Install Drupal on Raspberry Pi With Drupal Pi

Drupal Pi is an easy means to add Drupal to the Raspberry Pi for a web server. As its GitHub page explains, this is a derivative of the Raspberry Pi Dramble project which provides the functionality to make a Drupal cluster installation on Raspberry Pi devices. This, however, is intended for a solitary Raspberry Pi running Drupal.

First, you'll need Raspbian running on your Raspberry Pi board. A Raspberry Pi 2, 3, or 3 B+ is recommended. With a Raspberry Pi running Raspbian or Raspbian Lite, you'll first need to install both Ansible and Git. To do so, run:

sudo apt-get update && sudo apt-get install -y python-dev python-pip libffi-dev git && sudo pip install ansible​

You can check if Ansible installed correctly with:

ansible --version​

Once that's complete, download the repository. Clone the Drupal Pi Git directory:

git clone https://github.com/geerlingguy/drupal-pi.git && cd drupal-pi​

Then, copy the example.config.yml to config.yml and its example.inventory to inventory. After that, install Ansible roles:

ansible-galaxy install -r requirements.yml​

Finally, launch the Ansible playbook:

ansible-playbook -i inventory -c local main.yml​

Wait a few minutes, then open http://www.drupalpi.test/ which should yield the appropriate test page. 

Install Drupal on Raspberry Pi 

While Drupal Pi is an easy way to run Drupal on a Raspberry Pi board, you may install it via the command line standalone. In a terminal, run:

sudo apt-get install drupal7​

You'll be prompted to configure the database. Select yes and continue. Now, choose the database type. Next, select a MySQL application password. In a command line, enter:

cd /etc​


sudo cp /etc/drupal/7/apache2.conf /etc/apache2/mods-enabled/drupal.conf​

Then, restart the web server with:

sudo service apache2 restart​

In a web browser, navigate to [your IP address]/drupal7/install.php

From here, pick an installation profile. You can opt for minimal or standard. Click save and continue. Pick a language, then continue. Now, you'll need to wait for some basic installation to complete.

After that finishes, configure your site. You'll need to enter a site name and email address, as well as username, site maintenance email address, password, as well as enter server settings. This includes picking a default country, time zone, and choosing your update notifications settings. When you finish, click save and continue. Now, you'll have a link to visit your website. 

Install Drupal Raspberry Pi: Final Thoughts

Running Drupal on a Raspberry Pi is pretty simple. You've got a few methods for installing Drupal, including a command line installation of Drupal 7 as well as Drupal Pi. You'll find Raspberry Pi Drupal performance fine for a basic site, but it's not ideal for running a comprehensive web server. I was pleasantly surprised that installing Drupal on a Raspberry Pi 2 worked reasonably well. Still, a Raspberry Pi 4 will yield the best performance, but you can absolutely get Drupal running on a Raspberry Pi 2 or 3/3 B+. Running a Drupal web server off of a Raspberry Pi provides an easy, low-cost means of making a web server. If you'd rather create a cluster, check out Dramble which allows you to create a cluster of Pis running Drupal. 

More powerful hardware is definitely preferred. For instance, I won't be switching my personal website over to a self-hosted site on a Raspberry Pi. But for something basic, or to learn about web servers, installing Drupal on the Raspberry Pi offers a fun, simple project idea. Opting for a cluster set up provides greater Drupal performance on a Raspberry Pi. 

What servers are you running on your Raspberry Pi?

Leave your feedback...