How to Install October CMS on Ubuntu 18.04 LTS

OctoberCMS is a free and open source Content Management System (CMS) and web platform based on the PHP programming language and Laravel web application. It is simple, fast and modular that allows you to create powerful and dynamic content websites. OctoberCMS allows you to blogs or websites without having any prior knowledge about coding from scratch in a graphical way similar to other CMS software. OctoberCMS is an ideal tool for web artisan or a small-to-medium digital studio. OctoberCMS has an extensive range of capabilities such as users, permissions, themes, and plugins.

In this tutorial, we will be going to explain how to install OctoberCMS on Ubuntu 18.04 server.

Requirements

  • A server running Ubuntu 18.04.
  • A static IP address 192.168.0.11 is set up on your server.
  • A root password is set up on your server.

Getting Started

Before starting, you will need to update your system with the latest version. You can do this by running the following command:

apt-get update -y
apt-get upgrade -y

Once your server is updated, restart your server to apply the changes.

Install Apache, MariaDB, and PHP

First, you will need to install Apache web server, MariaDB database server, PHP and other PHP modules to your system. You can install all of them by running the following command:

apt-get install apache2 mariadb-server php7.2 libapache2-mod-php7.2 libapache2-mod-php7.2 php7.2-json php7.2-common php7.2-mbstring php7.2-xmlrpc php7.2-soap php7.2-gd php7.2-xml php7.2-intl php7.2-tidy php7.2-mysql php7.2-cli php7.2-ldap php7.2-pdo php7.2-zip php7.2-curl php7.2-sqlite3 unzip wget -y

Once all the packages are installed, open the php.ini file to make some changes:

nano /etc/php/7.2/apache2/php.ini

Make the following changes:

file_uploads = On
allow_url_fopen = On
memory_limit = 256M
upload_max_filesize = 30M
post_max_size = 40M
max_execution_time = 60
max_input_vars = 1500

Save and close the file. Then, start Apache and MariaDB service and enable them to start on boot time with the following command:

systemctl start apache2
systemctl start mariadb
systemctl enable apache2
systemctl enable mariadb

Configure Database

By default, MariaDB is not secured. So, you will need to secure it. You can do this by running the mysql_secure_installation script:

mysql_secure_installation

Answer all the questions as shown below:

    Enter current password for root (enter for none):
    Set root password? [Y/n]: N
    Remove anonymous users? [Y/n]: Y
    Disallow root login remotely? [Y/n]: Y
    Remove test database and access to it? [Y/n]:  Y
    Reload privilege tables now? [Y/n]:  Y

Once the MariaDB is secured, log in to MariaDB shell with the following command:

mysql -u root -p

Enter your root password when prompt. Then, create a database and user for OctoberCMS using the following command:

MariaDB [(none)]> CREATE DATABASE octoberdb;
MariaDB [(none)]> CREATE USER 'october'@'localhost' IDENTIFIED BY 'password';

Next, grant all the privileges to octoberdb database with the following command:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON octoberdb.* TO 'october'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Next, flush the privileges and exit from the MariaDB shell with the following command:

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

Install OctoberCMS

First, you will need to download the latest version of OctoberCMS from Git repository. You can download it with the following command:

wget https://codeload.github.com/octobercms/install/zip/master -O octobercms.zip

Once the download is completed, unzip the downloaded file with the following command:

unzip octobercms.zip

Next, move the extracted directory to the Apache web root directory with the following command:

mv install-master /var/www/html/octobercms

Next, give proper permissions to the octobercms directory with the following command:

chown -R www-data:www-data /var/www/html/octobercms
chmod -R 755 /var/www/html/octobercms

Configure Apache for OctoberCMS

First, you will need to create an apache virtual host file for OctoberCMS. You can do it with the following command:

nano /etc/apache2/sites-available/octobercms.conf

Add the following lines:

<VirtualHost *:80>
     ServerAdmin [email protected]
     ServerName 192.168.0.103
     DocumentRoot /var/www/html/octobercms/

     <Directory /var/www/html/octobercms/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog /var/log/apache2/october_error.log
     CustomLog /var/log/apache2/october_access.log combined
</VirtualHost>

Save and close the file. Then, disable the Apache default virtual host file and enable OctoberCMS virtual host file with the following command:

a2ensite octobercms
a2dissite 000-default

Next, enable Apache rewrite module and restart the Apache service with the following command:

a2enmod rewrite
systemctl restart apache2

Next, check the status of Apache service with the following command:

systemctl status apache2

You should see the following output:

? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           ??apache2-systemd.conf
   Active: active (running) since Wed 2019-01-30 10:56:45 UTC; 6s ago
  Process: 6498 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 6517 (apache2)
    Tasks: 1 (limit: 1114)
   CGroup: /system.slice/apache2.service
           ??6517 /usr/sbin/apache2 -k start

Jan 30 10:56:45 ubuntu1804 systemd[1]: Starting The Apache HTTP Server...
Jan 30 10:56:45 ubuntu1804 apachectl[6498]: AH00557: apache2: apr_sockaddr_info_get() failed for ubuntu1804
Jan 30 10:56:45 ubuntu1804 apachectl[6498]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. S
Jan 30 10:56:45 ubuntu1804 systemd[1]: Started The Apache HTTP Server.

Access OctoberCMS

Open your web browser and type the URL http://192.168.0.11/install.php. You will be redirected to the following page:

OctoberCMS System Check

Accept the license

Ensure all the required checks return a pass and accept the license agreement. You should see the following output:

Database configuration

Configure administrator user

Now, provide all the required information like, database name, database username, password, admin username and password. Then, click on the Continue button. You should see the following output:

Getting started with October CMS

Now, click on the Start from a theme button. You should see the following output:

Choose a Theme

Now, install the plugins as per your need. Once the installation has been completed successfully. You should see the following output:

Installation successful

Now, access the Administration Area. You will be redirected to the following page:

Login to admin area

Now, provide your admin username and password, then click on the Login button. You will be redirected to the OctoberCMS dashboard in the following page:

OctoberCMS dashboard

Congratulations! you have successfully installed OctoberCMS to your Ubuntu 18.04 server. You can now build your own blog or website easily using OctoberCMS. Feel free to ask me if you have any questions.

Share this page:

1 Comment(s)