Installing October CMS on Hostinger

Tutorial

On this page

Hostinger is a web hosting provider whose plans are managed from its own control panel, hPanel. Its web hosting plans come with PHP, MySQL, Composer and free SSL certificates, and run websites on the LiteSpeed web server, which reads the .htaccess file that October CMS includes. This article installs October CMS on a Hostinger web hosting plan over SSH and sets up the scheduler.

Tip: Hostinger also offers October CMS as a one-click Docker template for its VPS plans, which deploys October CMS on a virtual server of your own.

Before You Begin

The installation runs over SSH, which is included with the Premium web hosting plan and above, but not with the Single plan.

October CMS requires PHP 8.2 or higher and Composer 2, both of which you set up below.

The installer asks for your License Key, so have it ready from your October CMS account before you start.

Add your domain as a website in hPanel, starting with an empty website rather than WordPress or the website builder. This article uses example.com for the domain.

Set the PHP Version

In hPanel, open the website and go to Advanced → PHP Configuration. Choose PHP 8.2 or higher, for example 8.4, and save the change.

On the PHP extensions tab of the same page, check that the extensions October CMS requires are enabled: curl, gd, mbstring, openssl, pdo_mysql, simplexml and zip.

Create the Database

Go to Databases → Management and create a new MySQL database with its own user and password. Hostinger adds your account's prefix to both names, for example u123456789_october. Note the full database name, username and password, as the installer asks for them.

Connect with SSH

Go to Advanced → SSH Access and enable SSH. The page shows the server's IP address, the port (Hostinger uses 65002 rather than the usual 22) and your username, which starts with u followed by numbers. Set a password there or add an SSH key, then connect from your computer's terminal.

ssh -p 65002 u123456789@123.45.67.89

Use the Same PHP Version in SSH

The PHP version chosen in hPanel is the one the website runs on, but commands in SSH can run on a different, older version. Check the version SSH uses.

php -v

If it shows a version below 8.2, put the version you chose in hPanel first in your path. Hostinger keeps each PHP version in its own folder, for example /opt/alt/php84 for PHP 8.4. The following commands add it for this and future SSH sessions.

echo 'export PATH="/opt/alt/php84/usr/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
php -v

Create the Project

Change to the website's public_html folder, replacing example.com with your domain.

cd ~/domains/example.com/public_html

A new website comes with Hostinger's placeholder files, such as default.php. Composer needs an empty folder, so list the folder's contents with ls -A and remove them.

rm default.php

Create the project with Composer. On Hostinger, the composer command is Composer 1, so use the composer2 command, which is Composer 2. The dot at the end installs October CMS into the current folder, which is the website's root.

composer2 create-project october/october .

Install October CMS

Run the installation command.

php artisan october:install

The installer asks a series of questions. Use the following answers for Hostinger, pressing ENTER to accept a default value shown in brackets.

Prompt Answer
Select Language en, or another language code from the table
Application URL https://example.com
Backend URI /admin (or a custom address for the admin panel)
Database Engine MySQL
Database Host localhost
Database Port 3306
Database Name The full database name, for example u123456789_october
Database Login The full database username
Database Password The database user's password
Install the demonstration theme and content? yes
License Key Your license key

After the license key is accepted, the installer downloads the October CMS packages with Composer.

Tip: If the installation appears to freeze after entering the license key, press the ENTER key several times to allow the process to continue.

The last step is the migration command that initializes the database.

php artisan october:migrate

Open the Website

Open https://example.com in your browser to see the website. Add /admin to the URL (or the custom backend URI you chose) to open the admin panel and create your first administrator account.

Hostinger installs a free SSL certificate for the domain automatically. If the website doesn't open over https yet, check the certificate's status under Security → SSL in hPanel.

Set Up the Scheduler

October CMS runs its scheduled tasks from a cron job that runs every minute. Go to Advanced → Cron Jobs, choose the Custom type, set it to run once per minute and enter the following command, replacing u123456789 with your username and example.com with your domain.

/opt/alt/php84/usr/bin/php /home/u123456789/domains/example.com/public_html/artisan schedule:run

Use the same PHP version as the website, as above. Cron jobs that start with /usr/bin/php can run on an older version.

Before launching the website, review the production configuration.

See Also

Was this article helpful?

comments powered by Disqus
Still need help?
October Forum

Community members share experiences, ask questions and exchange tips.

Discord

Talk with other October CMS developers in real time.

Custom Development

Hire the October CMS team to work on your website.

Contact Us

For bug reports and help with this website. See the roadmap or submit an idea on the Portal.