Main menu

Installing Drupal on Raspberry Pi

This guide will teach you how to install Drupal 7 on a Raspberry Pi

Prerequisites

Before you get started with this guide, you will need Raspbian installed and updated. You will also need to have Apache, PHP, and MySQL configured on your server. Follow my LAMP guide here.

Once you have fulfilled the above requirements, continue on with this guide.

Step-by-Step Install Drupal 7 via Software Repositories

Step 1.  Install latest version of drupal (drupal7) from the repositories with following commands:

sudo apt-get update
sudo apt-get install drupal7

Step 2. Registering Drupal to apache with following command:

sudo cp /etc/drupal/7/apache2.conf /etc/apache2/mods-enabled/drupal.conf
sudo /etc/init.d/apache2 restart

Step 3. Create database with command below,in case we’ll create database with name “dbdrupal”

mysql -u root -p
CREATE DATABASE dbdrupal;

Logout from mysql server

quit

Step 4. Install drupal from your favorite browser by typing http://host/drupal7/install.php

Step-by-step Installing Drupal 7 Manually

Step 1. Download and extract all drupal files into /var/www/ directory:

sudo -i
cd /var/www
wget http://ftp.drupal.org/files/projects/drupal-7.36.tar.gz
tar xvf drupal-7.36.tar.gz
mv drupal-7.36/ drupal

Step 2. Change an ownership of all Drupal installation files to www-data user.

chown -R www-data.www-data /var/www/drupal/

Step 3. Create a MySQL database to be used by our new Drupal 7 installation, Let’s create and use following credentials:

  • Database: dbdrupal
  • User: drupaluser
  • Password: drupalpass
mysql -u root -p
create database dbdrupal;
CREATE USER drupaluser;

Create password: “drupalpass” for user: “drupaluser”

SET PASSWORD FOR drupaluser = PASSWORD("drupalpass");

Grant user drupaluser all permissions on the database.

GRANT ALL PRIVILEGES ON dbdrupal.* TO drupaluser@localhost IDENTIFIED BY "drupalpass";

Logout from mysql server

quit

Step 4. Navigate your browser to Apache’s hostname or IP address and follow Drupal 7 installer (http://hostname/drupal) to complete your own Drupal  installation.

 

Good luck!