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:
Create a Dockerfile
Create a
Dockerfilein the root of your repository to build Chamilo LMS:FROM php:8.3-apacheWORKDIR /var/www/html# Install system dependenciesRUN 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 extensionsRUN 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 ComposerCOPY --from=composer:latest /usr/bin/composer /usr/bin/composer# Install Node.jsRUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \apt-get install -y nodejs && \npm install -g yarn# Enable Apache modulesRUN a2enmod rewrite ssl headers expires# Copy application codeCOPY . .# Copy Apache configurationCOPY docker/apache.conf /etc/apache2/sites-available/000-default.conf# Install PHP dependenciesRUN composer install --no-dev --optimize-autoloader# Install Node dependencies and build assetsRUN yarn set version stable && \yarn install && \yarn build# Create necessary directoriesRUN mkdir -p var/log var/cache && \chown -R www-data: var/# Configure PHP settingsRUN 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 portEXPOSE 8080# Create entrypoint scriptCOPY docker/entrypoint.sh /entrypoint.shRUN chmod +x /entrypoint.shCMD ["/entrypoint.sh"]Create Apache Configuration
Create
docker/apache.conffor Apache virtual host configuration:<VirtualHost *:8080>ServerName localhostDocumentRoot /var/www/html/public<Directory /var/www/html/public>AllowOverride AllRequire all grantedRewriteEngine OnRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^ index.php [QSA,L]</Directory><LocationMatch "/(\.git|vendor|node_modules|var|tests)/">Require all denied</LocationMatch># Performance and security headersHeader 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 Chamilophp_value upload_max_filesize 256Mphp_value post_max_size 256Mphp_value session.save_handler "redis"php_value session.save_path "tcp://redis:6379"php_value session.cookie_httponly 1php_value session.cookie_secure 1php_value session.cookie_samesite "Lax"ErrorLog ${APACHE_LOG_DIR}/error.logCustomLog ${APACHE_LOG_DIR}/access.log combined</VirtualHost>Create Entrypoint Script
Create
docker/entrypoint.shto handle initialization:#!/bin/bashset -eecho "Initializing Chamilo LMS..."# Create .env file if it doesn't existif [ ! -f /var/www/html/.env.local ]; thenecho "Creating .env.local from environment variables..."cp /var/www/html/.env.dist /var/www/html/.env.local# Substitute environment variablessed -i "s|DATABASE_URL=.*|DATABASE_URL=${DATABASE_URL}|g" /var/www/html/.env.localsed -i "s|REDIS_URL=.*|REDIS_URL=${REDIS_URL}|g" /var/www/html/.env.localsed -i "s|APP_ENV=dev|APP_ENV=${APP_ENV:-prod}|g" /var/www/html/.env.localfi# Wait for database to be readyecho "Waiting for database..."for i in {1..30}; doif php /var/www/html/bin/console doctrine:query:sql "SELECT 1" > /dev/null 2>&1; thenecho "Database is ready"breakfiecho "Database not ready, retrying... ($i/30)"sleep 2done# Run migrationsecho "Running database migrations..."php /var/www/html/bin/console doctrine:migrations:migrate --no-interaction# Clear cacheecho "Clearing cache..."php /var/www/html/bin/console cache:clear# Install assetsecho "Installing assets..."php /var/www/html/bin/console assets:install --no-interaction --symlink# Fix permissionschown -R www-data: /var/www/html/var /var/www/html/.env.localecho "Starting Apache..."apache2-foregroundCreate Environment Configuration
Create
.env.distas a template for environment variables:# ApplicationAPP_ENV=prodAPP_DEBUG=0APP_SECRET=ChangeMe!SecretKey!# DatabaseDATABASE_URL=mysql://chamilo:chamilo_pass@mariadb:3306/chamilo# RedisREDIS_URL=redis://redis:6379# EmailMAILER_DSN=sendgrid+api://YOUR_SENDGRID_KEY@default# SecurityCORS_ALLOW_ORIGIN=^https?://example-app\.klutch\.sh$# UploadsUPLOAD_MAX_FILESIZE=256MPOST_MAX_SIZE=256M# Optional: JWT ConfigurationJWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pemJWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pemJWT_PASSPHRASE=ChangeMe!JWT_TTL=3600Create .gitignore
Ensure sensitive files aren’t committed to GitHub by creating
.gitignore:.env.env.local.env.*.localvar/cache/var/logs/vendor/node_modules/public/build/public/bundles/public/uploads/.DS_Store*.logcomposer.lockyarn.lockPush to GitHub
Commit and push your Chamilo configuration to your GitHub repository:
Terminal window git add Dockerfile docker/ .env.dist .gitignoregit commit -m "Add Klutch.sh deployment configuration for Chamilo LMS"git push origin mainDeploy on Klutch.sh
- Log in to your Klutch.sh dashboard at klutch.sh/app
- Click “Create New App” and select your GitHub repository containing Chamilo LMS
- Klutch.sh will automatically detect the Dockerfile in your repository
- Configure your deployment:
- Set your custom domain (e.g.,
chamilo.example.com) - Configure HTTP traffic on port 8080
- Set your custom domain (e.g.,
- Click “Deploy” to start the deployment process
- Monitor the deployment logs to ensure successful startup and database migrations
Configure Persistent Storage
After your deployment is complete, attach persistent storage for courses and learner data:
- From your app’s dashboard, navigate to the “Storage” or “Volumes” section
- Click “Add Volume”
- Set the mount path to
/var/www/html/public/uploads(where course materials and user uploads are stored) - Set the volume size based on your expected course content (starting with 100GB recommended)
- Confirm and wait for the volume to be attached
- 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
- Navigate to your Chamilo LMS instance URL (e.g.,
https://chamilo.example.com) - You’ll be redirected to the installation wizard at
/main/install/index.php - 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.)
- After installation completes, log in with your admin credentials
Creating Your First Course
- Log in to the Chamilo dashboard as an administrator
- Navigate to “Course Management” or the Courses section
- Click “Create a new course”
- Enter course details:
- Course code (e.g.,
INTRO101) - Course title
- Course description
- Category
- Language
- Course code (e.g.,
- Click “Create” to create the course
- Begin adding content, lessons, and assessments
Importing Users and Courses
You can bulk import users and courses using CSV files:
- Navigate to “User Management” or “Administration”
- Look for “Import users” or similar import functionality
- Prepare a CSV file with user data (username, password, email, first name, last name)
- Upload the CSV file and map columns to user fields
- Users will be created and can immediately access courses
Configuring Email Notifications
- Navigate to Settings or Administration
- Configure SMTP/Email settings with your mail service provider (SendGrid, Mailgun, etc.)
- Set the “from” email address for system notifications
- Test the email configuration
- 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 ConfigurationAPP_ENV=prodAPP_DEBUG=0APP_SECRET=your_super_secret_key_here_minimum_32_chars
# Database ConfigurationDATABASE_URL=mysql://chamilo_user:secure_password@database-host:3306/chamilo_db
# Redis Configuration for SessionsREDIS_URL=redis://redis-host:6379/0
# Mail ConfigurationMAILER_DSN=sendgrid+api://your_sendgrid_api_key@default
# Security and CORSCORS_ALLOW_ORIGIN=^https://chamilo\.example\.com$
# Upload LimitsUPLOAD_MAX_FILESIZE=256MPOST_MAX_SIZE=256MProduction Optimization
For production deployments with advanced features:
# SecurityAPP_ENV=prodAPP_DEBUG=0FORCE_HTTPS=1
# Database PerformanceDATABASE_URL=mysql://chamilo_user:password@db-host:3306/chamilo?charset=utf8mb4
# Redis for CachingREDIS_URL=redis://redis-host:6379/0CACHE_REDIS_DSN=redis://redis-host:6379/1
# JWT AuthenticationJWT_SECRET_KEY=%kernel.project_dir%/config/jwt/private.pemJWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pemJWT_PASSPHRASE=secure_jwt_passphraseJWT_TTL=3600
# Session ConfigurationSESSION_COOKIE_SECURE=1SESSION_COOKIE_HTTPONLY=1SESSION_COOKIE_SAMESITE=Lax
# LoggingLOG_CHANNEL=stackLOG_LEVEL=notice
# File UploadsUPLOAD_MAX_FILESIZE=512MPOST_MAX_SIZE=512MMAX_UPLOAD_SIZE=512000000Code 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 tokenTOKEN=$(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 1fi
echo "Authenticated successfully"echo "Importing users from $CSV_FILE..."
# Read CSV and import userswhile 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 directorymkdir -p "$BACKUP_DIR"
echo "Starting Chamilo backup at $TIMESTAMP..."
# Backup databaseecho "Backing up database..."mysqldump \ -h "$DATABASE_HOST" \ -u "$DATABASE_USER" \ -p"$DATABASE_PASSWORD" \ "$DATABASE_NAME" > "$BACKUP_DIR/database_$TIMESTAMP.sql"
# Compress database backupgzip "$BACKUP_DIR/database_$TIMESTAMP.sql"
# Backup uploadsecho "Backing up course files..."tar -czf "$BACKUP_DIR/uploads_$TIMESTAMP.tar.gz" \ /var/www/html/public/uploads/
# Backup configurationecho "Backing up configuration..."tar -czf "$BACKUP_DIR/config_$TIMESTAMP.tar.gz" \ /var/www/html/.env.local \ /var/www/html/config/
# Create manifestcat > "$BACKUP_DIR/manifest_$TIMESTAMP.txt" << EOFChamilo LMS Backup ManifestTimestamp: $TIMESTAMPDatabase: database_$TIMESTAMP.sql.gzUploads: uploads_$TIMESTAMP.tar.gzConfiguration: config_$TIMESTAMP.tar.gzEOF
# 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 buildbefore 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.localfile 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:
-
Pull Latest Code
Terminal window git fetch origingit pull origin master -
Update Dependencies
Terminal window composer install --no-dev --optimize-autoloaderyarn installyarn build -
Run Database Migrations After redeploying on Klutch.sh:
Terminal window php bin/console doctrine:migrations:migrate --no-interaction -
Clear Caches
Terminal window php bin/console cache:clear -
Push Changes
Terminal window git add .git commit -m "Update Chamilo to latest version"git push origin main -
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
- Official Chamilo Documentation
- Chamilo GitHub Repository
- Chamilo Community Forum
- Chamilo Training Programs
- Symfony 6 Documentation
- Vue.js Documentation
- MySQL/MariaDB Documentation
- Redis Documentation
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