11th February, 2017 | Tutorials |

How to Install Chamilo LMS on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.

Get a Cloud Server

Chamilo is a free and open source e-learning management system. It is written in PHP and uses MySQL/MariaDB to store its data. Chamilo provides all the necessary features needed to manage courses online. It provides different dashboards for user and teachers with social networking tools to communicate and learn. It also provides support for a multi-institutional mode with central management. Provides time controlled tasks as well as automated generation of certificates. Chamilo is used in more than 25 different countries and has a user base of thousands of students. It is also translated into more than 50 languages,


Chamilo does not require any special hardware requirements. It can be installed on servers with a small amount of RAM. But the hardware requirements increases as the number of courses and users increases. All the required dependencies will be installed throughout the tutorial. You will need a minimal installation of CentOS 7 with root access on it. If you are logged in as a non-root user, you can run sudo -i to switch to root user.

Installing Chamilo LMS

Before installing any package it is recommended that you update the packages and repository using the following command.

yum -y update

Once you have your system updated, you can proceed to install the LAMP stack. Start the LAMP installation by installing Apache web server and MariaDB, which is a fork of MySQL using the following command.

yum -y install httpd mariadb-server mariadb

Chamilo can be installed on any version of PHP greater than 5.3. But as PHP 5.3 has reached the end of life. You can install PHP 7 for high performance. PHP 7 is not included in default YUM repository, hence you will need to add the Webtatic repository in your system. Webtatic repository requires EPEL repository to work. Run the following command to install EPEL repository.

yum -y install epel-release yum -y update

Now install Webtatic repository using the following commands.

rpm -Uvh yum -y update

To install PHP 7.1 and all the required PHP modules, run the following command.

yum -y install php71w php71w-mysqli php71w-pear php71w-gd php71w-xml php71w-gd php71w-intl php71w-curl php71w-session php71w-zlib php71w-pcre php71w-json php71w-mcrypt php71w-mbstring php71w-ctype php71w-ldap php71w-xsl

Once you have PHP installed, you can check the version of PHP using the following command.

php -v You should get output similar to this.
[root@liptan-pc ~]# php -v
PHP 7.1.1 (cli) (built: Jan 19 2017 20:35:16) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies

Once PHP is installed, you will need to configure a few things in your php.ini configuration file. Open /etc/php.ini using your favorite editor.

nano /etc/php.ini

If you do not have nano installed, you can install it using yum -y install nano. Scroll down to find the following lines.

; Maximum amount of memory a script may consume (128MB)
memory_limit = 128M

You can increase the memory_limit to a higher amount, recommended it 256M so that the processing of PHP can also be done faster. Further find the following line,

; Defines the default timezone used by the date functions
;date.timezone = 

Uncomment and change the timezone according to your country. Further find:

max_execution_time = 30

Change the maximum execution time for a script to 300. Next, find

max_input_time = 60

Change the maximum amount of time each script may spend parsing request data for a script to 600. Further, find the following lines and change the values according to the instructions.

post_max_size = 8M    # Change to 100M
upload_max_filesize = 2M    # Change to 100M

You will also need to enable Mod_rewrite in Apache web server by editing /etc/httpd/conf/httpd.conf using your favorite text editor.

nano /etc/httpd/conf/httpd.conf

Find the following line.

<Directory "/var/www/html">
AllowOverride None

Change it to AllowOverride All.

Now start Apache web server and enable it to start at boot time using the following command.

systemctl start httpd systemctl enable httpd

To start MariaDB and enable it to start at boot time using the following commands.

systemctl start mariadb systemctl enable mariadb

Now run the following commands to secure your MySQL or MariaDB installation.


It will run a small script which asks you to provide the root password for MariaDB. As we have just installed MariaDB, the root password is not set, just press enter to proceed further. It will ask you if you want to set a root password for your MariaDB installation, choose y and set a strong password for the installation. It will also ask you for removing test databases and anonymous users. Most of the questions are self-explanatory and you should answer yes or y to all the questions.

To create a database we will need to login to MySQL command line first. Run the following command to do so.

mysql -u root -p

This will prompt you for the password, provide the root password of MySQL which you have set earlier. Now run the following query to create a new database for your Chamilo installation.

CREATE DATABASE chamilo_data;

The above query will create a database named chamilo_data. For the database, you can use any name you prefer at the place of chamilo_data. Make sure that you use semicolon at the end of each query as the query always ends with a semicolon. Once the database is created you can create a new user and grant all the permissions to the user for the database. Using root user is not recommended for the databases. To create a new database user, run the following query.

CREATE USER 'chamilo_user'@'localhost' IDENTIFIED BY 'StrongPassword';

The above query will create a user with username chamilo_user. You can use any preferred username instead of chamilo_user. Replace StrongPassword with a strong password. Now provide the appropriate privileges to your database user over the database you have created. Run the following command.

GRANT ALL PRIVILEGES ON chamilo_data.* TO 'chamilo_user'@'localhost';

Now run the following command to immediately apply the changes on the database privileges.


Exit from MySQL prompt using exit command.

As we have all the dependencies ready, we can now download the install package from the Chamilo site.

cd /tmp wget -O

The above command will download the installer archive and store it as file. You can always look for the latest release by going to the Chamilo download page.

Extract the archive using the following command.

unzip -q

If you don't have unzip installed, you can run yum -y install unzip. The above command will extract the files under chamilo-lms-1.11.2 directory. To move all the files from chamilo-lms-1.11.2 folder to the default web root directory including the hidden .htaccess file, use the following command.

mv /tmp/chamilo*/{.[!.],}* /var/www/html

Now you will need to disable your SELinux because Chamilo does not work with SELinux policies. To temporary disable SELinux, run the following command.

setenforce 0

To completely disable the SELinux you will need to edit /etc/selinux/config file.

nano /etc/selinux/config

If you don't have nano installed, you can install it using yum -y install nano. Find the following line:


Change it to:


Now you will need to reboot your server so that the new configuration can take effect. Once the server is rebooted, you will need to provide the ownership of the application to web server user using the following command.

chown -R apache:apache /var/www/html

You may also need to allow HTTP traffic on port 80 through the firewall if you are running one. Run the following commands for same.

firewall-cmd --zone=public --permanent --add-service=http firewall-cmd --reload

Now complete the installation using a web browser, go to the following link using your favorite web browser.


You will see following welcome interface.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/755025717.png" alt="" />

Click on Install Chamilo button and you will be taken to the next interface where you will need to choose the language of installation.

On clicking next, the installer will perform and system requirements check, if you have followed this tutorial correctly, the server should have all the necessary requirements installed.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/2112074228.png" alt="" />

Click New Installation button to proceed further. Now you will need to accept the license agreement to proceed further. The page also contains an optional contact information form. Click Next to proceed further. Now you will need to provide the database details of the database and database user we have created earlier. Populate the form with correct database credentials and click Check database connection button.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/151607844.png" alt="" />

If the credentials are correct, you will get a success message. Click Next button to go to next interface.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/560415100.png" alt="" />

In this interface, you will need to provide the administrator and portal details. Populate the fields using the correct values and click Next Button. Now, the installer will show you the configuration you entered for the new installation. If everything is correct, click Install Chamilo button to write the changes to the database.

For security reasons, you will need to delete the install folder and provide appropriate read-only permissions to app/config/ directory. Run the following commands for same.

rm -rf /var/www/html/install chmod -R 555 /var/www/html/app/config/

You can now access the LMS frontend at the following URL.


You will see the following site.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/2091264952.png" alt="" />

To access the administrator panel, log in using the credentials provided during installation, you will see the following interface.

HP_NO_IMG/data/uploads/users/e840080c-7322-4497-85c0-150182bd4c02/1547324252.png" alt="" />


In this tutorial, we have learned how to install Chamilo LMS on CentOS 7. You can now easily install Chamilo to create an online learning portal for your institute.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.

Get a Cloud Server