How To Install Sulu CMS on Hostinger

sulu-logo

Sulu is the replacement of WordPress

Sulu CMS is a powerful alternative to WordPress and Drupal. Built on the Symfony PHP framework, an enterprise-grade, versatile platform, it can be easily integrated with other front-end frameworks if needed. This article will guide you through the steps to install Sulu CMS on Hostinger.

The first step is to log in to your Hostinger account and create an empty PHP/HTML website. You can assign it as a subdomain, use a temporary domain, or connect it to your own domain. Next, enable SSH access. In the Website Dashboard, select ‘Advanced’ from the menu on the left, then click on ‘SSH Access.’ Enable the SSH access (there’s a button on the right under SSH Status box), set your SSH password, copy and paste your SSH username and password.

For the PHP settings needed for Sulu CMS, select ‘Advanced’ -> ‘PHP Configuration’, and select these PHP extensions: sodium

On your Windows PC, open the terminal by typing ‘PowerShell’ in the search box, and log in using the SSH command you just copied. This is how to install Sulu CMS from the Hostinger composer:

### SSH terminal

$ cd $HOME/domains/<your-sulu-cms-project-domain> 

$ composer2 create-project sulu/skeleton hostinger-sulu

This will create a directory named ‘hostinger-sulu/’ inside your $HOME/ as the base directory for your Sulu CMS project. You’ll need to redirect the ‘public_html/’ directory (the root of your website) to Sulu’s ‘public/’ directory.

### SSH terminal

$ rm -fr $HOME/domains/<your-sulu-cms-project-domain>/public_html 

$ ln -s $HOME/domains/<your-sulu-cms-project-domain>/hostinger-sulu/public $HOME/domains/<your-sulu-cms-project-domain>/public_html

The next step is to create an database for Sulu CMS to work with. Go to Hostinger Website Dashboard->Database, and set the MySQL database name, username and password. Click ‘Create’ button. Copy this info to your Sulu ‘.env’ file.

$ mysql -V # To check MySQL version 

### Edit $HOME/domains/<your-sulu-cms-project-domain>/hostinger-sulu/.env file through hPanel File Manager (or just use vim from your SSH terminal), and add this line 

DATABASE_URL="mysql://<MySQL username> :<MySQL passwd>@127.0.0.1:3306/<dBase name>?serverVersion=<MySQL version>&charset=utf8mb4"

If you done it correctly, the Sulu CMS will complain about not getting the routing table from the database.

sulu-installation-1

Sulu website key

That’s it. We are almost there. Before we populate the database, we need to create a key for our website. Sulu CMS can handle multiple website using a single codebase, and each website must have its unique key (which you can define by yourself).

### Edit $HOME/domains/<your-sulu-cms-project-domain>/hostinger-sulu/config/webspaces/website.xml

    <name>Hostinger Sulu Demo</name>

    <key>hostinger250311</key> 

### Execute this in your SSH shell to create the tables in the database 

$ cd $HOME/domains/<your-sulu-cms-project-domain>/hostinger-sulu/ php bin/adminconsole sulu:build dev 

### The backend user 'admin' (with a password 'admin') is now added into your system. I'd suggest for you to change the default password.

Your frontpage now will look like this

sulu-installation-2 sulu-installation-3

Sulu admin backend

To access your backend, use https://<your-domain-where-you-installed-sulu>/admin

Ok. So login using ‘admin’ username (and ‘admin’ password), change your username / password and enjoy your new Sulu CMS installation. If you have any comment, please contact me or email me or leave a comment on this post. C ya.

Posted in Sulu CMS

Leave Your Comment

(*) These fields are required