How to Install Chamilo 1.11.8 on CentOS 7

Updated on January 25, 2019
How to Install Chamilo 1.11.8 on CentOS 7 header image

Chamilo is a free and open source learning management system (LMS) which is widely used for online education and team collaboration all around the world.

In this article, I will show you how to deploy the latest stable release of Chamilo on a CentOS 7 server instance.


  • A fresh Vultr CentOS 7 x64 server instance with sufficient memory. 8GB or more is recommended in production. Say its IPv4 address is
  • A sudo user.
  • The server instance has been updated to the latest stable status using the EPEL YUM repo. See details here.
  • A domain,, being pointed to the server instance mentioned above.

Modify firewall rules

In production, you need to modify firewall rules in order to allow only inbound TCP traffic on the SSH, HTTP, and HTTPS ports:

sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo systemctl reload firewalld.service

Install Apache 2.4

On CentOS 7, you can use YUM to install the latest stable release of Apache:

sudo yum install httpd httpd-devel -y

Remove the pre-set Apache welcome page:

sudo sed -i 's/^/#&/g' /etc/httpd/conf.d/welcome.conf

Start the Apache service and make it auto-start on every system boot:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Install and secure MariaDB

Setup a YUM repo for the latest stable release of MariaDB on the system:

cat <<EOF | sudo tee /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.3 CentOS repository list - created 2018-09-25 14:01 UTC
name = MariaDB
baseurl =

Install MariaDB using the newly created MariaDB YUM repo:

sudo yum install -y MariaDB-server MariaDB-client

Start the MariaDB service and make it auto-start on every system boot:

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Secure MariaDB:

sudo /usr/bin/mysql_secure_installation

Press Enter to use the defaults, and choose a secure password when prompted:

Install required PHP 7.2.x packages

In order to get greater performance on the Chamilo LMS server, it's recommended to install PHP 7.2 packages rather than legacy PHP 5.x packages. Currently, you can use the Webtatic YUM repo to install required packages:

sudo rpm -Uvh
sudo yum install -y mod_php72w php72w-opcache php72w-cli php72w-common php72w-gd php72w-intl php72w-mbstring php72w-mysqlnd php72w-process php72w-soap php72w-xml php72w-xmlrpc php72w-ldap php72w-pecl-apcu

Backup and update the PHP config file:

sudo cp /etc/php.ini /etc/php.ini.bak
sudo sed -i 's#;date.timezone =#date.timezone = America/Los_Angeles#' /etc/php.ini

Note: When working on your own server instance, make sure to replace the example timezone value America/Los_Angeles with your own. You can find all of the supported timezone values here.

Create a dedicated MariaDB database for Chamilo LMS

Log into the MariaDB shell as root:

mysql -u root -p

In the MariaDB shell, input the following statements:

CREATE USER 'chamilouser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON chamilo.* TO 'chamilouser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;

Note: For security purposes, be sure to replace the database name chamilo, the database username chamilouser, and the password yourpassword with your own ones.

Prepare the Chamilo LMS files

Download the latest stable release of Chamilo from the Chamilo GitHub repo. Be sure to choose the PHP 7.x-oriented release:


Extract all of the Chamilo files to the /opt directory:

sudo tar -zxvf chamilo-1.11.8-php7.tar.gz -C /opt

In order to facilitate daily use and potential updates, create a symbolic link, which is pointing to the /opt/chamilo-1.11.8-php7 directory, in the Apache web root directory /var/www/html:

sudo ln -s /opt/chamilo-1.11.8-php7 /var/www/html/chamilo

Modify the ownership of all Chamilo files to the apache user and the apache group:

sudo chown -R apache:apache /opt/chamilo-1.11.8-php7

Fine tune PHP 7.2 settings for Chamilo

Use the vi editor to open the same PHP config file we edited earlier:

sudo vi /etc/php.ini

Find the following lines respectively:

session.cookie_httponly =
upload_max_filesize = 2M
post_max_size = 8M

One by one, replace them as follows:

session.cookie_httponly = 1
upload_max_filesize = 100M
post_max_size = 100M

Save and quit:


Setup an Apache virtual server for Chamilo LMS

Setup an Apache virtual host for your Chamilo LMS site:

cat <<EOF | sudo tee /etc/httpd/conf.d/chamilo.conf
<VirtualHost *:80>
DocumentRoot /var/www/html/chamilo
<Directory />
AllowOverride All
Require all granted
<Directory /var/www/html/chamilo>
Options FollowSymLinks
AllowOverride All
Require all granted
ErrorLog /var/log/httpd/
CustomLog /var/log/httpd/ common

Restart the Apache service to put all of your modifications into effect:

sudo systemctl restart httpd.service

Finish the installation in a web browser

Point your favorite web browser to, and you will be brought into the Chamilo installation wizard. Click the Install Chamilo button to move on. The following section will walk you through the installation process:

  • Step 1 - Installation Language: Choose the language you'd like to use, such as English, and then click the Next button.
  • Step 2 – Requirements: Make sure that all mandatory requirements have been met, and then click the New installation button.
  • Step 3 – Licence: You need to review the GNU General Public licence (GPL), select the checkbox next to the I agree sentence, fill in all of the contact info fields, and then click the Next button to move on.
  • Step 4 – MySQL database settings: Input the database credentials we setup earlier and then click the Check database connection button to verify them. Once verified, click the Next button to move on.
  • Step 5 – Config settings: Make sure to modify the pre-set administrator password (a random string), fill in other fields according to your business plan, and then click the Next button to move on.
  • Step 6 – Last check before install: Review all of the settings and then click the Install chamilo button to start the web installation.
  • Step 7 – Installation process execution: When Chamilo is successfully installed, click the Go to your newly created portal. button to finish the web installation wizard.

Execute post-installation safety measures

In addition, two post-installation safety measures you need to take are listed below:

sudo chmod -R 0555 /var/www/html/chamilo/app/config
sudo rm -rf /var/www/html/chamilo/main/install