Skip to content

Deploying Chamilo LMS

Chamilo LMS is a comprehensive learning management system designed with a focus on ease of use and accessibility. Built on PHP with Symfony 6 framework and Vue.js for the frontend, Chamilo enables organizations and educational institutions to deliver online courses, manage learner progress, and create engaging learning experiences.

Introduction to Chamilo LMS

Chamilo is a mature, open-source learning management system that has served over 30 million users worldwide since its inception in 2010. The platform is designed to be intuitive and accessible, making it easy for educators and learners to navigate and use effectively. Chamilo 2.0 represents a modern architecture built on the Symfony 6 framework with a progressive Vue.js frontend.

The platform is actively maintained by the Chamilo Association and a vibrant community of contributors. Whether you’re running a small training program, managing courses for a university, or delivering corporate training, Chamilo provides the tools and flexibility you need to create and manage effective online learning experiences.

Chamilo supports multiple learning methodologies, from traditional course delivery to collaborative learning and assessment. The system is designed to be accessible to learners with diverse needs, complying with international accessibility standards. With built-in support for integrations, plugins, and customization, Chamilo can adapt to your specific organizational requirements.

Key Features

Chamilo LMS is packed with powerful learning management capabilities:

  • Course Management: Create and organize courses with flexible lesson structures and content organization
  • Lesson Building: Develop interactive lessons with multimedia support and inline exercises
  • Assessment Tools: Create quizzes, exercises, and exams with automatic grading and feedback
  • Virtual Classroom: Live online learning with video conferencing integration capabilities
  • Discussion Forums: Collaborative learning spaces for peer-to-peer discussion and instructor-led conversations
  • Assignment Management: Collect, grade, and provide feedback on student assignments
  • Gradebook: Track student progress with comprehensive grading and analytics
  • Certificate Generation: Automatically issue certificates upon course completion
  • Attendance Tracking: Monitor and record learner attendance and engagement
  • Progress Tracking: Monitor student progress through courses and identify at-risk learners
  • Bulk Import: Import courses, users, and enroll learners in bulk from CSV files
  • Mobile Responsive: Access learning content on desktop, tablet, and mobile devices
  • User Management: Manage users, roles, permissions, and organizational hierarchies
  • Learning Path Management: Create structured learning journeys with prerequisite tracking
  • Session Management: Organize courses into sessions with individual user management
  • Plugin Architecture: Extend Chamilo with plugins for custom functionality
  • REST API: Full API support for custom integrations and third-party systems
  • JWT Authentication: Secure token-based authentication for API access
  • Reporting and Analytics: Detailed reports on course completion, learner engagement, and performance
  • GDPR Compliance: Built-in privacy controls and compliance features
  • Accessibility: WCAG 2.1 compliance for inclusive learning experiences

Prerequisites

Before deploying Chamilo LMS on Klutch.sh, ensure you have the following:

  • A Klutch.sh account and dashboard access at klutch.sh/app
  • A GitHub repository containing Chamilo LMS source code (or a fork of the official repository)
  • Basic knowledge of Docker and containerization
  • Understanding of learning management systems and educational technology
  • Familiarity with PHP applications and Symfony framework
  • A database service (MariaDB/MySQL) for course and user data
  • Redis instance for session management
  • A custom domain for your Chamilo instance (recommended)

Important Considerations

Deployment Steps

Follow these steps to deploy Chamilo LMS on Klutch.sh:

  1. Create a Dockerfile

    Create a Dockerfile in the root of your repository to build Chamilo LMS:

    FROM php:8.3-apache
    WORKDIR /var/www/html
    # Install system dependencies
    RUN apt-get update && apt-get install -y \
    git \
    curl \
    unzip \
    libicu-dev \
    zlib1g-dev \
    libzip-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    libfreetype6-dev \
    redis \
    mysql-client \
    && rm -rf /var/lib/apt/lists/*
    # Compile PHP extensions
    RUN docker-php-ext-configure gd --with-freetype --with-jpeg && \
    docker-php-ext-install -j$(nproc) \
    intl \
    zip \
    gd \
    mysqli \
    pdo \
    pdo_mysql \
    redis \
    bcmath \
    curl \
    soap \
    xml
    # Install Composer
    COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
    # Install Node.js
    RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
    apt-get install -y nodejs && \
    npm install -g yarn
    # Enable Apache modules
    RUN a2enmod rewrite ssl headers expires
    # Copy application code
    COPY . .
    # Copy Apache configuration
    COPY docker/apache.conf /etc/apache2/sites-available/000-default.conf
    # Install PHP dependencies
    RUN composer install --no-dev --optimize-autoloader
    # Install Node dependencies and build assets
    RUN yarn set version stable && \
    yarn install && \
    yarn build
    # Create necessary directories
    RUN mkdir -p var/log var/cache && \
    chown -R www-data: var/
    # Configure PHP settings
    RUN echo "upload_max_filesize = 256M" >> /usr/local/etc/php/conf.d/uploads.ini && \
    echo "post_max_size = 256M" >> /usr/local/etc/php/conf.d/uploads.ini && \
    echo "session.save_handler = redis" >> /usr/local/etc/php/conf.d/redis.ini && \
    echo "session.save_path = tcp://redis:6379" >> /usr/local/etc/php/conf.d/redis.ini
    # Expose port
    EXPOSE 8080
    # Create entrypoint script
    COPY docker/entrypoint.sh /entrypoint.sh
    RUN chmod +x /entrypoint.sh
    CMD ["/entrypoint.sh"]
  2. Create Apache Configuration

    Create docker/apache.conf for Apache virtual host configuration:

    <VirtualHost *:8080>
    ServerName localhost
    DocumentRoot /var/www/html/public
    <Directory /var/www/html/public>
    AllowOverride All
    Require all granted
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^ index.php [QSA,L]
    </Directory>
    <LocationMatch "/(\.git|vendor|node_modules|var|tests)/">
    Require all denied
    </LocationMatch>
    # Performance and security headers
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-XSS-Protection "1; mode=block"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    # Caching for static assets
    <FilesMatch "\.(jpg|jpeg|png|gif|svg|css|js|woff|woff2|ttf|eot)$">
    Header set Cache-Control "max-age=2592000, public"
    Header set Expires "max-age=2592000"
    </FilesMatch>
    # PHP settings for Chamilo
    php_value upload_max_filesize 256M
    php_value post_max_size 256M
    php_value session.save_handler "redis"
    php_value session.save_path "tcp://redis:6379"
    php_value session.cookie_httponly 1
    php_value session.cookie_secure 1
    php_value session.cookie_samesite "Lax"
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    </VirtualHost>
  3. Create Entrypoint Script

    Create docker/entrypoint.sh to handle initialization:

    #!/bin/bash
    set -e
    echo "Initializing Chamilo LMS..."
    # Create .env file if it doesn't exist
    if [ ! -f /var/www/html/.env.local ]; then
    echo "Creating .env.local from environment variables..."
    cp /var/www/html/.env.dist /var/www/html/.env.local
    # Substitute environment variables
    sed -i "s|DATABASE_URL=.*|DATABASE_URL=${DATABASE_URL}|g" /var/www/html/.env.local
    sed -i "s|REDIS_URL=.*|REDIS_URL=${REDIS_URL}|g" /var/www/html/.env.local
    sed -i "s|APP_ENV=dev|APP_ENV=${APP_ENV:-prod}|g" /var/www/html/.env.local
    fi
    # Wait for database to be ready
    echo "Waiting for database..."
    for i in {1..30}; do
    if php /var/www/html/bin/console doctrine:query:sql "SELECT 1" > /dev/null 2>&1; then
    echo "Database is ready"
    break
    fi
    echo "Database not ready, retrying... ($i/30)"
    sleep 2
    done
    # Run migrations
    echo "Running database migrations..."
    php /var/www/html/bin/console doctrine:migrations:migrate --no-interaction
    # Clear cache
    echo "Clearing cache..."
    php /var/www/html/bin/console cache:clear
    # Install assets
    echo "Installing assets..."
    php /var/www/html/bin/console assets:install --no-interaction --symlink
    # Fix permissions
    chown -R www-data: /var/www/html/var /var/www/html/.env.local
    echo "Starting Apache..."
    apache2-foreground
  4. Create Environment Configuration

    Create .env.dist as a template for environment variables:

    # Application
    APP_ENV=prod
    APP_DEBUG=0
    APP_SECRET=ChangeMe!SecretKey!
    # Database
    DATABASE_URL=mysql://chamilo:chamilo_pass@mariadb:3306/chamilo
    # Redis
    REDIS_URL=redis://redis:6379
    # Email
    MAILER_DSN=sendgrid+api://YOUR_SENDGRID_KEY@default
    # Security
    CORS_ALLOW_ORIGIN=^https?://example-app\.klutch\.sh$
    # Uploads
    UPLOAD_MAX_FILESIZE=256M
    POST_MAX_SIZE=256M
    # Optional: JWT Configuration
    JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
    JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
    JWT_PASSPHRASE=ChangeMe!
    JWT_TTL=3600
  5. Create .gitignore

    Ensure sensitive files aren’t committed to GitHub by creating .gitignore:

    .env
    .env.local
    .env.*.local
    var/cache/
    var/logs/
    vendor/
    node_modules/
    public/build/
    public/bundles/
    public/uploads/
    .DS_Store
    *.log
    composer.lock
    yarn.lock
  6. Push to GitHub

    Commit and push your Chamilo configuration to your GitHub repository:

    Terminal window
    git add Dockerfile docker/ .env.dist .gitignore
    git commit -m "Add Klutch.sh deployment configuration for Chamilo LMS"
    git push origin main
  7. Deploy on Klutch.sh

    1. Log in to your Klutch.sh dashboard at klutch.sh/app
    2. Click “Create New App” and select your GitHub repository containing Chamilo LMS
    3. Klutch.sh will automatically detect the Dockerfile in your repository
    4. Configure your deployment:
      • Set your custom domain (e.g., chamilo.example.com)
      • Configure HTTP traffic on port 8080
    5. Click “Deploy” to start the deployment process
    6. Monitor the deployment logs to ensure successful startup and database migrations
  8. Configure Persistent Storage

    After your deployment is complete, attach persistent storage for courses and learner data:

    1. From your app’s dashboard, navigate to the “Storage” or “Volumes” section
    2. Click “Add Volume”
    3. Set the mount path to /var/www/html/public/uploads (where course materials and user uploads are stored)
    4. Set the volume size based on your expected course content (starting with 100GB recommended)
    5. Confirm and wait for the volume to be attached
    6. Your Chamilo instance will automatically use persistent storage for all uploaded files and course materials

Initial Setup and Configuration

After your Chamilo LMS deployment is live, complete the initial setup:

Running the Installation Wizard

  1. Navigate to your Chamilo LMS instance URL (e.g., https://chamilo.example.com)
  2. You’ll be redirected to the installation wizard at /main/install/index.php
  3. Follow the installation steps:
    • Choose your language
    • Accept the terms of use
    • Configure database connection (should use values from environment variables)
    • Set up the administrator account with strong credentials
    • Configure platform settings (platform name, URLs, etc.)
  4. After installation completes, log in with your admin credentials

Creating Your First Course

  1. Log in to the Chamilo dashboard as an administrator
  2. Navigate to “Course Management” or the Courses section
  3. Click “Create a new course”
  4. Enter course details:
    • Course code (e.g., INTRO101)
    • Course title
    • Course description
    • Category
    • Language
  5. Click “Create” to create the course
  6. Begin adding content, lessons, and assessments

Importing Users and Courses

You can bulk import users and courses using CSV files:

  1. Navigate to “User Management” or “Administration”
  2. Look for “Import users” or similar import functionality
  3. Prepare a CSV file with user data (username, password, email, first name, last name)
  4. Upload the CSV file and map columns to user fields
  5. Users will be created and can immediately access courses

Configuring Email Notifications

  1. Navigate to Settings or Administration
  2. Configure SMTP/Email settings with your mail service provider (SendGrid, Mailgun, etc.)
  3. Set the “from” email address for system notifications
  4. Test the email configuration
  5. Enable notifications for course activities (new messages, assignments, etc.)

Environment Variables

Basic Configuration

These are the essential environment variables needed for Chamilo LMS to function:

# Application Configuration
APP_ENV=prod
APP_DEBUG=0
APP_SECRET=your_super_secret_key_here_minimum_32_chars
# Database Configuration
DATABASE_URL=mysql://chamilo_user:secure_password@database-host:3306/chamilo_db
# Redis Configuration for Sessions
REDIS_URL=redis://redis-host:6379/0
# Mail Configuration
MAILER_DSN=sendgrid+api://your_sendgrid_api_key@default
# Security and CORS
CORS_ALLOW_ORIGIN=^https://chamilo\.example\.com$
# Upload Limits
UPLOAD_MAX_FILESIZE=256M
POST_MAX_SIZE=256M

Production Optimization

For production deployments with advanced features:

# Security
APP_ENV=prod
APP_DEBUG=0
FORCE_HTTPS=1
# Database Performance
DATABASE_URL=mysql://chamilo_user:password@db-host:3306/chamilo?charset=utf8mb4
# Redis for Caching
REDIS_URL=redis://redis-host:6379/0
CACHE_REDIS_DSN=redis://redis-host:6379/1
# JWT Authentication
JWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pem
JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
JWT_PASSPHRASE=secure_jwt_passphrase
JWT_TTL=3600
# Session Configuration
SESSION_COOKIE_SECURE=1
SESSION_COOKIE_HTTPONLY=1
SESSION_COOKIE_SAMESITE=Lax
# Logging
LOG_CHANNEL=stack
LOG_LEVEL=notice
# File Uploads
UPLOAD_MAX_FILESIZE=512M
POST_MAX_SIZE=512M
MAX_UPLOAD_SIZE=512000000

Code Examples

PHP - Course API Integration

Here’s a PHP example for managing courses via the Chamilo API:

<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpClient\HttpClient;
use Symfony\Component\HttpFoundation\Response;
class CourseController extends AbstractController
{
public function manageCourses()
{
$client = HttpClient::create();
// Get JWT Token
$response = $client->request('POST', 'https://chamilo.example.com/api/authentication_token', [
'json' => [
'username' => 'admin',
'password' => 'admin_password'
]
]);
$data = $response->toArray();
$token = $data['token'];
// Get list of courses
$coursesResponse = $client->request('GET', 'https://chamilo.example.com/api/courses', [
'headers' => [
'Authorization' => "Bearer $token"
]
]);
$courses = $coursesResponse->toArray();
return $this->json([
'success' => true,
'courses' => $courses
]);
}
public function createCourse()
{
$client = HttpClient::create();
// Create new course
$response = $client->request('POST', 'https://chamilo.example.com/api/courses', [
'json' => [
'title' => 'New Course Title',
'description' => 'Course description',
'code' => 'NEWC101',
'category_id' => 1,
'language' => 'en'
],
'headers' => [
'Authorization' => "Bearer $token",
'Content-Type' => 'application/json'
]
]);
$course = $response->toArray();
return $this->json([
'success' => true,
'course' => $course
]);
}
}

Bash - User Import Script

Here’s a Bash script for bulk importing users into Chamilo:

#!/bin/bash
CHAMILO_URL="https://chamilo.example.com"
ADMIN_USER="admin"
ADMIN_PASS="admin_password"
CSV_FILE="$1"
# Get JWT token
TOKEN=$(curl -s -X POST "$CHAMILO_URL/api/authentication_token" \
-H "Content-Type: application/json" \
-d "{\"username\":\"$ADMIN_USER\",\"password\":\"$ADMIN_PASS\"}" \
| jq -r '.token')
if [ -z "$TOKEN" ] || [ "$TOKEN" = "null" ]; then
echo "Failed to authenticate"
exit 1
fi
echo "Authenticated successfully"
echo "Importing users from $CSV_FILE..."
# Read CSV and import users
while IFS=',' read -r username email firstname lastname password; do
# Skip header
if [ "$username" = "username" ]; then
continue
fi
echo "Importing user: $username"
# Create user via API
curl -s -X POST "$CHAMILO_URL/api/users" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"username\":\"$username\",
\"email\":\"$email\",
\"firstname\":\"$firstname\",
\"lastname\":\"$lastname\",
\"plainPassword\":\"$password\",
\"status\":1
}" > /dev/null
echo "✓ User $username imported"
done < "$CSV_FILE"
echo "Import completed"

Shell - Chamilo Backup Script

Here’s a Shell script for backing up Chamilo data:

#!/bin/sh
BACKUP_DIR="/backups/chamilo"
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
DATABASE_HOST="mariadb"
DATABASE_NAME="chamilo"
DATABASE_USER="chamilo"
# Create backup directory
mkdir -p "$BACKUP_DIR"
echo "Starting Chamilo backup at $TIMESTAMP..."
# Backup database
echo "Backing up database..."
mysqldump \
-h "$DATABASE_HOST" \
-u "$DATABASE_USER" \
-p"$DATABASE_PASSWORD" \
"$DATABASE_NAME" > "$BACKUP_DIR/database_$TIMESTAMP.sql"
# Compress database backup
gzip "$BACKUP_DIR/database_$TIMESTAMP.sql"
# Backup uploads
echo "Backing up course files..."
tar -czf "$BACKUP_DIR/uploads_$TIMESTAMP.tar.gz" \
/var/www/html/public/uploads/
# Backup configuration
echo "Backing up configuration..."
tar -czf "$BACKUP_DIR/config_$TIMESTAMP.tar.gz" \
/var/www/html/.env.local \
/var/www/html/config/
# Create manifest
cat > "$BACKUP_DIR/manifest_$TIMESTAMP.txt" << EOF
Chamilo LMS Backup Manifest
Timestamp: $TIMESTAMP
Database: database_$TIMESTAMP.sql.gz
Uploads: uploads_$TIMESTAMP.tar.gz
Configuration: config_$TIMESTAMP.tar.gz
EOF
# Cleanup old backups (keep last 30 days)
find "$BACKUP_DIR" -type f -mtime +30 -delete
echo "✓ Backup completed: $BACKUP_DIR"
du -sh "$BACKUP_DIR"

Best Practices

When deploying and managing Chamilo LMS on Klutch.sh, follow these best practices:

  • Strong Passwords: Use strong, unique passwords for admin accounts and database users
  • Regular Backups: Implement automated daily backups of your database and uploaded files
  • Security Updates: Keep Chamilo and all dependencies updated to the latest versions
  • Database Optimization: Regularly optimize your database tables and monitor query performance
  • Redis Caching: Use Redis for session management and caching to improve performance
  • Asset Optimization: Build production assets with yarn build before deployment
  • Upload Limits: Configure appropriate upload limits based on your server capacity
  • User Management: Implement proper user roles and permissions for course access
  • HTTPS Only: Always use HTTPS in production to protect learner data
  • Monitoring: Monitor server resources, database performance, and application logs
  • Disaster Recovery: Test your backup and recovery procedures regularly
  • Accessibility: Ensure courses meet WCAG 2.1 accessibility standards for inclusive learning

Troubleshooting

Common Issues and Solutions

Issue: Installation wizard not appearing

  • Verify the database is running and accessible
  • Check that the .env.local file has correct database credentials
  • Clear cache: php bin/console cache:clear
  • Ensure proper file permissions on var/ directory

Issue: Slow course loading or performance issues

  • Verify Redis is properly configured and running
  • Check database query performance and add indexes if needed
  • Monitor disk I/O on the persistent volume
  • Verify adequate server resources (CPU, memory)

Issue: File uploads failing

  • Check upload limits in PHP configuration and Nginx
  • Verify persistent volume has sufficient free space
  • Ensure proper write permissions on uploads directory
  • Check disk space: df -h /var/www/html/public/uploads

Issue: Database migration errors

  • Ensure database user has proper privileges
  • Check database character set is utf8mb4
  • Review migration logs for specific errors
  • Consider running migrations manually via CLI

Issue: Asset files not loading (CSS/JavaScript broken)

  • Run asset install: php bin/console assets:install --no-interaction
  • Rebuild assets: yarn build (for production)
  • Clear browser cache (Ctrl+Shift+Delete)
  • Check Nginx caching headers configuration

Issue: Email notifications not sending

  • Verify MAILER_DSN is correctly configured
  • Test SMTP credentials with mail test tool
  • Check email logs: tail -f var/log/chamilo.log | grep mail
  • Verify from email address is valid

Issue: Redis connection errors

  • Verify Redis service is running
  • Check REDIS_URL environment variable
  • Test connection: redis-cli -h redis-host ping
  • Monitor Redis memory usage

Update Instructions

To update Chamilo LMS to the latest version:

  1. Pull Latest Code

    Terminal window
    git fetch origin
    git pull origin master
  2. Update Dependencies

    Terminal window
    composer install --no-dev --optimize-autoloader
    yarn install
    yarn build
  3. Run Database Migrations After redeploying on Klutch.sh:

    Terminal window
    php bin/console doctrine:migrations:migrate --no-interaction
  4. Clear Caches

    Terminal window
    php bin/console cache:clear
  5. Push Changes

    Terminal window
    git add .
    git commit -m "Update Chamilo to latest version"
    git push origin main
  6. Redeploy on Klutch.sh

    • Navigate to your app in Klutch.sh dashboard
    • Trigger a redeploy
    • Monitor logs for successful startup

Use Cases

Educational Institutions

Universities and schools can use Chamilo to deliver online courses, manage student enrollments, track progress, and facilitate collaboration between instructors and learners. Support for learning paths helps organize complex curriculum structures.

Corporate Training Programs

Organizations can deploy Chamilo for employee onboarding, compliance training, and professional development. The platform supports multiple instructors and training administrators managing courses for large user populations.

Skill Development and Certifications

Training providers can use Chamilo to offer skill-based courses with automatic certification upon completion. The assessment tools help validate learner competencies and track achievement.

Language Learning Programs

Language schools can leverage Chamilo’s multimedia support for audio and video content, discussion forums for conversation practice, and assessments for language proficiency evaluation.

Professional Development Platforms

Professional associations and training companies can create comprehensive learning ecosystems on Chamilo with course catalogs, instructor management, and learner progress tracking.

Additional Resources

Conclusion

Deploying Chamilo LMS on Klutch.sh gives you a powerful, accessible learning management system capable of supporting educational institutions and organizations of any size. By following this guide, you’ve set up a production-ready Chamilo instance with proper database configuration, file storage, and session management.

Chamilo’s focus on ease of use, accessibility, and flexibility makes it an excellent choice for delivering online learning experiences. The platform’s mature codebase, active community, and extensive feature set provide the foundation for creating effective learning environments.

Remember to maintain regular backups, keep your instance updated with security patches, monitor system performance, and follow the best practices outlined in this guide. With Chamilo running on Klutch.sh, you have a reliable, scalable platform ready to support your learning goals.

For additional support and to connect with the Chamilo community, visit the official documentation, join the community forum, or explore training programs to become a Chamilo expert.


Author: Davaughn White