Install Chamilo LMS on Ubuntu 20.04

Updated on December 15, 2021
Install Chamilo LMS on Ubuntu 20.04 header image

Introduction

Chamilo is a free and open-source e-Learning Management System (LMS) and content management system based on PHP. It's used for online education and team collaboration by creating a virtual educational community for the students to access online courses. Some major features are:

  • Courses and sessions management.
  • User management, authentication, and enrollment.
  • Data import/export to CSV/Excel format.
  • Social network for learning purposes.
  • Availability timeframe for tests/exams.

This article explains how to install Chamilo LMS on Ubuntu 20.04 server.

Prerequisites

1. Install Required Packages

Install all the required packages and modules needed by Chamilo LMS to run.

  1. SSH to your server as a non-root user with sudo access.

  2. Update the system package list to update all packages to the latest available versions.

     $ sudo apt update
  3. Install PHP 7.4 and more modules.

     $ sudo apt install apache2 mysql-server php7.4 libapache2-mod-php7.4 php7.4-json php7.4-curl php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-common php7.4-sqlite3 php7.4-curl php7.4-intl php7.4-mbstring php7.4-gd php7.4-zip php7.4-imap php7.4-ldap php7.4-apcu php7.4-cli php7.4-zip wget unzip -y
  4. List available time zones and choose your preference.

     $ sudo timedatectl list-timezones
  5. Edit the PHP configuration file.

     $ sudo nano /etc/php/7.4/apache2/php.ini

    Change the following values, and replace Africa/Nairobi with your timezone save and close the file. To search for a specific line, use Control+W, enter search phrase then press Enter.

     max_execution_time = 360
     memory_limit = 512M
     upload_max_filesize = 100M
     date.timezone = Africa/Nairobi
  6. Restart Apache2 service for all changes made to take effect.

     $ sudo systemctl restart apache2

2. Create Chamilo LMS Database

Create an empty Chamilo LMS database that will be used in later steps for connecting to the application. All the highlighted names can be changed to your preferred names.

  1. Log in to MySQL shell. At the password prompt, just press Enter to continue.

     $ sudo mysql -u root -p
  2. Create a database called chamilo.

     CREATE DATABASE chamilo;
  3. Create a database user called chamilouser with a password StrongPassword.

     CREATE USER 'chamilouser'@'localhost' IDENTIFIED BY 'StrongPassword';
  4. Grant the user full access to the database.

     GRANT ALL ON chamilo.* TO 'chamilouser'@'localhost' WITH GRANT OPTION;
  5. Save the changes.

     FLUSH PRIVILEGES;
  6. Exit the shell.

     exit;

3. Install Chamilo LMS

  1. Download the latest version of Chamilo LMS. Find the newest version of this software on the official download page.

     $ wget https://github.com/chamilo/chamilo-lms/releases/download/v1.11.16/chamilo-1.11.16.zip
  2. Extract the downloaded files.

     $ sudo unzip chamilo-1.11.16.zip
  3. Create the installation directory /var/www/html/chamilo.

     $ sudo mkdir /var/www/html/chamilo
  4. Move the extracted files to the installation directory.

     $ sudo mv chamilo-1.11.16/* /var/www/html/chamilo
  5. Change ownership of the installation directory.

     $ sudo chown -R www-data:www-data /var/www/html/chamilo/
  6. Change access permissions for the installation directory.

     $ sudo chmod -R 755 /var/www/html/chamilo/

4. Configure Apache2

  1. Create a new Apache configuration file called chamilo.conf.

     $ sudo nano /etc/apache2/sites-available/chamilo.conf

    Then copy and paste the code below into the file. Finally, save and close the file.

     <VirtualHost *:80>
         ServerAdmin admin@example.com
         DocumentRoot /var/www/html/chamilo
         ServerName example.com
    
         <Directory /var/www/html/chamilo/>
             Options FollowSymlinks
             AllowOverride All
             Require all granted
         </Directory>
    
         ErrorLog ${APACHE_LOG_DIR}/error.log
         CustomLog ${APACHE_LOG_DIR}/access.log combined
     </VirtualHost>
  2. Disable Apache default configuration file.

     $ sudo a2dissite 000-default.conf
  3. Enable Chamilo LMS Apache configuration file.

     $ sudo a2ensite chamilo.conf
  4. Enable Apache rewrite mode.

     $ sudo a2enmod rewrite
  5. Restart Apache service.

     $ sudo systemctl restart apache2

5. Access Chamilo LMS Web Interface

To access the Chamilo LMS Web Interface, go to your browser and visit http://Server_IP/. For example:

http://192.0.2.10/

Conclusion

You have installed Chamilo LMS on your server. After confirming that all the required packages are installed, complete installation by setting up your site information, creating an administrator account, and connecting your application to the database. You can now access the dashboard and configure it to begin managing your online courses.