Install Fuel CMS on Ubuntu 20.04

Updated on September 13, 2021
Install Fuel CMS on Ubuntu 20.04 header image

Introduction

Fuel CMS (Content Management System) is an open-source platform for creating websites and cloud-based applications. Fuel CMS is built with the CodeIgniter framework and designed to work with an existing LAMP stack installation. You can switch between the WYSIWYG editor and HTML editor when authoring content, according to your needs. Fuel CMS supports multiple languages and has an active online community.

In this guide, you'll install and configure the Fuel CMS package with a LAMP stack on Ubuntu 20.04 server.

Prerequisites

To complete this tutorial, you need:

1. Configure Apache and Install Dependencies

Connect to your server with SSH as your non-root sudo user for the following steps.

  1. Enable the Apache mod_rewrite module, which allows Fuel CMS to create human-readable URLs.

     $ sudo a2enmod rewrite
  2. Install the libapache2-mod-php module.

     $ sudo apt install -y libapache2-mod-php
  3. Restart Apache to load the new configuration.

     $ sudo systemctl restart apache2
  4. Install unzip, which you need to extract the installation archives.

     $ sudo apt install unzip

2. Create a Database and User Account

Fuel CMS requires either MySQL or MariaDB for data storage.

  1. Log in to your database server as root.

     $ sudo mysql -u root -p
  2. Enter your root password and press Enter to log in.

  3. Create a fuel_cms database and fuel_cms_user user account. Replace EXAMPLE_PASSWORD with a strong value.

    Use the steps for your database engine.

    If you use MySQL:

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

    If you use MariaDB:

     MariaDB> CREATE DATABASE fuel_cms;
              GRANT ALL PRIVILEGES on fuel_cms.* TO 'fuel_cms_user'@'localhost' identified by 'EXAMPLE_PASSWORD';
  4. Exit the database command-line interface.

     mysql> EXIT;

3. Download Fuel CMS

  1. Create a new fuel_cms directory under the root of your web server.

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

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

     $ cd /var/www/fuel_cms
  4. Download the Fuel CMS installation files from GitHub.

     $ wget https://github.com/daylightstudio/FUEL-CMS/archive/master.zip
  5. Unzip the installation archive.

     $ unzip master.zip
  6. Move the extracted files to /var/www/fuel_cms.

     $ mv /var/www/fuel_cms/FUEL-CMS-master/* /var/www/fuel_cms/
  7. Remove master.zip and the FUEL-CMS-master directory.

     $ rm master.zip
     $ rm -rf FUEL-CMS-master

4. Configure Fuel CMS

  1. Edit the database configuration.

     $ sudo nano /var/www/fuel_cms/fuel/application/config/database.php
  2. Locate the $db['default'] section. Edit the username, password, and database values as shown. Replace EXAMPLE_PASSWORD with the password you created in section 2.

     $db['default'] = array(
             'dsn'   => '',
             'hostname' => 'localhost',
             'username' => 'fuel_cms_user',
             'password' => 'EXAMPLE_PASSWORD',
             'database' => 'fuel_cms',
             'dbdriver' => 'mysqli',
    
     );
  3. Save and exit the file.

  4. Initialize the fuel_cms database.

     $ mysql -u fuel_cms_user -p fuel_cms < /var/www/fuel_cms/fuel/install/fuel_schema.sql
  5. When prompted, enter the MySQL password for the fuel_cms_user account and press Enter to run the SQL.

  6. Create a strong random encryption key for Fuel CMS.

     $ openssl rand -base64 20

    The key looks similar to:

     S8t207l6l3p1TGShxtKJX1Yn0k4=
  7. Copy the key to your clipboard.

  8. Edit the Fuel CMS configuration file.

     $ sudo nano /var/www/fuel_cms/fuel/application/config/config.php
  9. Locate the $config['encryption_key'] section and enter your random encryption key as the value. When finished, it should look like this, except with your unique random key.

     $config['encryption_key'] = 'S8t207l6l3p1TGShxtKJX1Yn0k4=';
  10. Save and exit the file.

  11. Edit MY_fuel.php.

     $ sudo nano /var/www/fuel_cms/fuel/application/config/MY_fuel.php
  12. Find the $config['admin_enabled'] section and change the value from FALSE to TRUE as shown.

     $config['admin_enabled'] = TRUE;
  13. Fuel CMS uses the Apache mod_rewrite module and .htaccess directives to create user-friendly URLs. Create a new .htaccess file in the /var/www/fuel_cms/fuel/ directory.

     $ sudo nano /var/www/fuel_cms/fuel/.htaccess

    Enter the settings below to make the URLs shorter and cleaner.

     <IfModule mod_rewrite.c>
    
         RewriteEngine On
    
         RewriteBase /
    
         RewriteCond %{REQUEST_FILENAME} !-f
         RewriteCond %{REQUEST_FILENAME} !-d
    
         RewriteRule .* index.php/$0 [L]
    
     </IfModule>
  14. Save and close the file.

  15. Give www-data ownership of the fuel_cms directory.

     $ sudo chown -R www-data:www-data /var/www/fuel_cms

5. Create a Virtual Host for Fuel CMS

  1. Disable the default Apache virtual host.

     $ sudo a2dissite 000-default.conf
  2. Create a new fuel_cms.conf Apache configuration file.

     $ sudo nano /etc/apache2/sites-available/fuel_cms.conf

    Paste the following information. Replace example.com with the server's domain name or public IP address.

     <VirtualHost *:80>
    
         ServerName example.com
    
         DocumentRoot "/var/www/fuel_cms"
    
         <Directory "/var/www/fuel_cms">
             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>
  3. Save and close the file.

  4. Enable the new configuration file.

     $ sudo a2ensite fuel_cms.conf
  5. Restart Apache to load the new virtual host.

     $ sudo systemctl restart apache2

6. Test the Installation

Visit your server's domain name or public IP address. For example, if your server's domain name is example.com, navigate to http://example.com.

You should see the welcome page. To access the administration page, append /fuel to the URL, like: http://example.com/fuel.

More Information