Install Backdrop CMS on Ubuntu 20.04

Updated on November 21, 2023
Install Backdrop CMS on Ubuntu 20.04 header image

Introduction

Backdrop CMS is a lightweight Content Management System. It was initially forked from Drupal CMS and features a refactored administration panel. Backdrop CMS is suitable for small and medium organizations and is maintained by an active developer community. This guide explains how to install Backdrop CMS on Ubuntu 20.04 server.

Prerequisites

To follow the steps in this guide, you need:

Optionally, you could deploy a Vultr One-Click LAMP server.

1. Install Dependencies

  1. SSH to your server as a non-root sudo user.

  2. Update the package information index.

     $ sudo apt update
  3. Install the libapache2-mod-php module.

     $ sudo apt install -y libapache2-mod-php
  4. Enable the Apache rewrite module, which allows Backdrop to write shorter and friendly URLs.

     $ sudo a2enmod rewrite
  5. Restart Apache to load the new changes.

     $ sudo systemctl restart apache2
  6. Install the unzip package, which you will need to extract the Backdrop installation archive.

     $ sudo apt install -y unzip

2. Create Database and User Account

Backdrop works with either MySQL or MariaDB server as the backend.

  1. Connect to your Database server as root.

     $ sudo mysql -u root -p
  2. Create a backdrop database and a privileged backdrop_user account.

    Execute the appropriate SQL statements for your database server and replace EXAMPLE_PASSWORD with a strong password.

    If you use MySQL:

     mysql> CREATE DATABASE backdrop;
            CREATE USER 'backdrop_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'EXAMPLE_PASSWORD';
            GRANT ALL PRIVILEGES ON backdrop.* TO 'backdrop_user'@'localhost';           
            FLUSH PRIVILEGES;

    If you use MariaDB:

     MariaDB> CREATE DATABASE backdrop;
              GRANT ALL PRIVILEGES on backdrop.* TO 'backdrop_user'@'localhost' identified by 'EXAMPLE_PASSWORD';
              FLUSH PRIVILEGES;
  3. Log out of the database server.

     mysql> EXIT;

3. Download Backdrop from GitHub

  1. Create a new /var/www/backdrop directory under the root of your web server.

     $ sudo mkdir -p /var/www/backdrop
  2. Take ownership the new /var/www/backdrop directory.

     $ sudo chown -R $USER:$USER /var/www/backdrop
  3. Navigate to the new directory.

     $ cd /var/www/backdrop
  4. Visit the official Backdrop download page on GitHub and copy the download link of the latest stable version.

  5. Download the Backdrop installation archive file.

     $ sudo wget https://github.com/backdrop/backdrop/releases/download/1.19.3/backdrop.zip
  6. Extract the zip file to your current directory.

     $ sudo unzip backdrop.zip
  7. Move the contents of the extracted backdrop directory to /var/www/backdrop.

     $ sudo mv backdrop/* /var/www/backdrop
  8. Give ownership of the /var/www/backdrop directory to www-data.

     $ sudo chown -R www-data:www-data /var/www/backdrop
  9. Delete the backdrop.zip file.

     $ sudo rm backdrop.zip

4. Create a Virtual Host File

Apache reads virtual hosts configurations from the /etc/apache2/sites-available directory.

  1. Disable the default 000-default.conf host file.

     $ sudo a2dissite 000-default.conf
  2. Create a new backdrop.conf file for the Backdrop package.

     $ sudo nano /etc/apache2/sites-available/backdrop.conf
  3. Paste the information below into the file. Replace example.com with your domain name or server's public IP address.

     <VirtualHost *:80>
    
         ServerName example.com
    
         DocumentRoot "/var/www/backdrop"
    
         <Directory "/var/www/backdrop">
             Require all granted
             Options -Indexes +FollowSymLinks
             AllowOverride All
             Order allow,deny
             Allow from all
         </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
     </VirtualHost>
  4. Save and close the file.

  5. Enable the new backdrop.conf file.

     $ sudo a2ensite backdrop.conf
  6. Restart Apache to load the new configuration.

     $ sudo systemctl restart apache2

5. Complete Backdrop Installation

Navigate to your server's public IP address or domain name in a web browser to complete the installation. For example:

http://example.com

More Information

See the Backdrop CMS documentation for more information.