October is an open source, powerful, and modular Content Management System (CMS) and that aims at making your development workflow simple and fast. October CMS  has been designed from scratch to solve problems that exist in other content management systems.

In this tutorial, I’ll cover how to install October CMS on Ubuntu 18.04 / Debian 9. But first, let’s list all October CMS dependencies.

  • Apache/Nginx web server
  • MySQL/MariaDB/PostgreSQL database server
  • PHP

This article will guide you through the installation of PHP and required extensions, Apache Web Server and MariaDB/MySQL Database server. So follow steps below to setup October CMS on Ubuntu 18.04 / Debian 9.

Step 1: Install PHP and required PHP extensions

The PHP version required by October CMS is version 7.0 or higher which is satisfied by PHP available on Ubuntu 18.04 & Debian 9.

sudo apt install -y php php-cli php-mysql php-zip php-json php-gd php-mbstring php-curl php-xml php-pear php-bcmath php-pdo openssl

Step 2: Install MySQL/MariaDB database server

I recommend using MariaDB database server since it is a fully open source, but you’re free to use MySQL Database server as well.

How to Install MariaDB 10.3 on Debian 9 / Debian 8

Install MariaDB 10.3 on Ubuntu 18.04 and CentOS 7

For MySQL installation, refer to the guides:

How to Install MySQL 8.0 on Ubuntu 18.04 / 16.04

Once the database server is installed, login to the mysql console to create a database for October

$ mysql -u root -p

CREATE USER 'october'@'localhost' IDENTIFIED BY 'StrongPassword';
CREATE DATABASE october;
GRANT ALL ON october.* TO 'october'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
QUIT

Test connection to Database

$ mysql  -u october -p

Enter password: <ENTER PASSWORD>
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 10.3.11-MariaDB-1:10.3.11+maria~stretch-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| october            |
+--------------------+
2 rows in set (0.001 sec)
MariaDB [(none)]> QUIT

Step 3: Install Apache2 Web Server

Now that you have Database and PHP installed, the remaining dependency is Apache2 web server. Run the following command to install Apache2 on Ubuntu 18.04 / Debian 9.

sudo apt -y install apache2 libapache2-mod-php unzip vim

The configuration of Apache for October CMS will appear under the next section.

Step 4: Install October CMS and Configure Apache

The last step is the installation of October CMS and configuring Apache web server.

wget http://octobercms.com/download -O octobercms.zip
unzip octobercms.zip
sudo mv install-master /srv/octobercms

Then set the correct permissions for /srv/octobercms

sudo chown -R www-data:www-data /srv/octobercms

Create Apache configuration file for October CMS.

sudo vim /etc/apache2/sites-enabled/octobercms.conf

Add:

<VirtualHost *:80>
     DocumentRoot /srv/octobercms/
     ServerName example.com
     ServerAlias www.example.com
     ServerAdmin [email protected]
 
     <Directory /srv/octobercms/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog /var/log/apache2/octobercms-error.log
     CustomLog /var/log/apache2/octobercms-access.log combined
</VirtualHost>

Enable Apache2 rewrite module

sudo a2enmod rewrite
sudo systemctl restart apache2

Step 5: Access October CMS Web Interface

Now open your browser and browse to your October CMS server domain name http://example.com/install.php

1. Ensure all checks return a pass and Accept License Agreement.

2. Fill database connection details

3. Specify details for Admin user then click Continue

4. Finish your site set up by choosing “Start from a theme”, then install the selected theme.

Your website is located at this URL: http://example.com and Administration Area is on http://example.com/backend

Use Provided links to access Backend Administration Area. The logins are as created during installation.

Step 6: Setting up the scheduler

For scheduled tasks to operate correctly, you should add the following Cron entry to your server. Edit crontab:

crontab -e

And add the following line at the end

* * * * * php /srv/octobercms/artisan schedule:run >> /dev/null 2>&1

Enjoy your newly installed October CMS on Ubuntu 18.04 / Debian 9.