Drupal is a free, scalable and open-source web management system (CMS) backed by a large community. Its applications are broad, ranging from building a professional blogging page to operating the official government site.

For a non-technical user who doesn’t have enough knowledge of web development, Drupal is a perfect platform to start their website-building journey since it offers creative website themes and tools to make a website from scratch easily.

For Raspberry Pi users, installing Drupal on the device isn’t a hard job, and this article will assist you in successfully installing Drupal on Raspberry Pi.

How to Install Drupal on Raspberry Pi

Here, in this guide, you will learn to install Drupal on a Raspberry Pi device so that you can begin hosting your website with ease.

To start using Drupal service on your Raspberry Pi device, you will need to perform the following steps:

Step 1: The initial step required from your side is to confirm whether the Raspberry Pi packages are up to date and for this reason, you will have to execute the following commands in the terminal.

$ sudo apt update

$ sudo apt upgrade

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image11-8.png" data-lazy- height="634" src="data:image/svg xml,” width=”833″>

Step 2: Now you will need the following utilities on your Raspberry Pi:

  • Apache web server
  • PHP 5.2 or higher
  • MySQL 

If you don’t have these utilities set up on your Raspberry Pi device, don’t worry you can install them by visiting our previously published article: install Apache, PHP, MySQL.

Step 3: Once you complete Step 2, you will then need to open up the Apache Virtual host configuration file by executing the following command in the terminal.

$ sudo nano /etc/apache2/apache2.conf

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image13-6.png" data-lazy- height="634" src="data:image/svg xml,” width=”829″>

With the file open, you will need to identify the following configuration text referring “” in the file.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image12-7.png" data-lazy- height="632" src="data:image/svg xml,” width=”835″>

Step 4: Now, change the text “AllowOverride None” to “AllowOverride All”. To save the file, use “Ctrl X”, press the “Y” button and move back to the command line window.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image15-3.png" data-lazy- height="632" src="data:image/svg xml,” width=”834″>

Step 5: After performing the above changes, you will also be required to execute the following command to rewrite the changes on apache2 module.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image14-5.png" data-lazy- height="144" src="data:image/svg xml,” width=”1039″>

Step 6: After that, you will need to install the PHP using the following command.

$ sudo apt install php-xml php-gd php-mbstring php-curl

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image17-1.png" data-lazy- height="632" src="data:image/svg xml,” width=”836″>

Step 7: After the installation, restart the Apache service using the below mentioned command.

$ sudo systemctl restart apache2.service

Step 8: In this step, you will need to create a Drupal database and credentials to allow Drupal to connect to your database. To do this, first you will need to connect to your database through the following command.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image16-2.png" data-lazy- height="149" src="data:image/svg xml,” width=”835″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image19.png" data-lazy- height="422" src="data:image/svg xml,” width=”837″>

Step 9: Next, you will need to create a Drupal database using the following command.

create database drupalDB;

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image18-1.png" data-lazy- height="507" src="data:image/svg xml,” width=”838″>

Step 10: Now, use the following commands to create a username and password which will be required later on when you connect to Drupal Database.

create user <Drupal_username>@localhost identified by ;

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image22.png" data-lazy- height="580" src="data:image/svg xml,” width=”835″>

Once it is done, execute the following commands one by one to finish setting up the database.

grant all privileges on drupalDB.* to <Drupal_username>@localhost;

flush privileges;

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image20.png" data-lazy- height="634" src="data:image/svg xml,” width=”834″>

To quit the database use “quit”.

Step 11: Next up, you will need to install the latest version of Drupal on your Raspberry Pi device and to do that you will need to download the Drupal zip file using below mentioned command.

$ wget https://www.drupal.org/download-latest/zip -O drupal.zip

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image21.png" data-lazy- height="632" src="data:image/svg xml,” width=”834″>

Step 12: Unzip the Drupal file into the root folder of Apache “/var/www/html” using:

$ sudo unzip drupal.zip -d /var/www/html/

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image23.png" data-lazy- height="93" src="data:image/svg xml,” width=”1040″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image24.png" data-lazy- height="634" src="data:image/svg xml,” width=”835″>

Step 13: Move to the Apache directory “/var/www/html/” using the following command.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image25.png" data-lazy- height="149" src="data:image/svg xml,” width=”835″>

Step 14: Now, to change the file ownership to the default Apache user, execute the following command.

$ sudo chown -R www-data:www-data ./

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image26.png" data-lazy- height="199" src="data:image/svg xml,” width=”836″>

Step 15: Remove the previous Apache index template using the below given command.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image27.png" data-lazy- height="222" src="data:image/svg xml,” width=”836″>

Step 16: Check your Drupal version first by going into the Apache folder “/var/www/html/” as it may vary. In our case it is Drupal-9.3.9 so, use the below given command to extract the file.

$ sudo mv drupal-9.3.9/* ./

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image28.png" data-lazy- height="150" src="data:image/svg xml,” width=”838″>

Also move the hidden files as well using the following command.

$ sudo mv drupal-9.3.9/.[!.]* ./

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image29.png" data-lazy- height="179" src="data:image/svg xml,” width=”832″>

Step 17: Finally remove the old Drupal folder using the following command.

$ sudo rmdir drupal-9.3.9/

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image30.png" data-lazy- height="189" src="data:image/svg xml,” width=”836″>

Step 18: After completing the above steps, go to your browser and enter your Raspberry Pi IP address in the URL bar to open the Drupal setting on your browser.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image1-23.png" data-lazy- height="620" src="data:image/svg xml,” width=”1135″>

Step 19: You will need to choose your language setting according to your preference and once choosen, click on the “Save and continue” option.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image2-21.png" data-lazy- height="599" src="data:image/svg xml,” width=”1111″>

Step 20: Choose an installation profile as “Standard” and then click on the “Save and continue” option.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image3-20.png" data-lazy- height="581" src="data:image/svg xml,” width=”1061″>

Step 21: In the next screen, you will review the requirements and enable the services that are required according to your preferences:

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image4-19.png" data-lazy- height="614" src="data:image/svg xml,” width=”1110″>

Step 22: Next up, fill the Database configuration you previously set in Step 9 and 10 and then click on the “Save and continue” option.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image5-19.png" data-lazy- height="593" src="data:image/svg xml,” width=”1075″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image6-18.png" data-lazy- height="592" src="data:image/svg xml,” width=”1073″>

This will begin the installation of Drupal on the browser.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image7-15.png" data-lazy- height="579" src="data:image/svg xml,” width=”1080″>

Step 23: Once the installation completes, you will need to configure your site with your choice. Fill the required information to set up your website.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image8-13.png" data-lazy- height="618" src="data:image/svg xml,” width=”1109″>

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image9-10.png" data-lazy- height="539" src="data:image/svg xml,” width=”939″>


Once you fill in the information and click on the “Save and continue” option, your website will appear on your browser as shown below.

<img alt="" data-lazy- data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/image10-9.png" data-lazy- height="518" src="data:image/svg xml,” width=”939″>

This also ensures that Drupal is successfully installed on your Raspberry Pi device and you can begin editing your website to give it a different look.

Conclusion

The installation of Drupal on Raspberry Pi will enable users the freedom to create and manage their websites without having the knowledge of HTML or web designing since it offers many templates that let you change the look of your website within no time. The installation steps are pretty simple and once you follow them carefully, you will then be able to run Drupal on your web browser and start editing your website with ease.

About the author

<img data-del="avatar" data-lazy-src="https://kirelos.com/wp-content/uploads/2022/04/echo/unnamesadadsasdd-150×150.jpg" height="112" src="data:image/svg xml,” width=”112″>

Awais Khan

I’m an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.