Prerequisites
Before you begin, ensure you have:- Git with Git LFS installed
- Python 3.9+ (but below 3.14) - we recommend using pyenv
- Node.js 20.19.x - installed via nodeenv (shown below)
- Terminal/Command Line access
Quick Setup
Follow these steps to get Kolibri running locally:Fork and Clone the Repository
First, fork the Kolibri repository on GitHub, then clone your fork:Initialize Git LFS and configure git blame:Add the upstream remote to track Learning Equality’s repository:
Set Up Python Virtual Environment
Create and activate a virtual environment using pyenv-virtualenv:
If you don’t have pyenv installed, see the full installation guide for alternative methods like venv, virtualenv, or pipenv.
Set Required Environment Variable
Set the This variable:
KOLIBRI_RUN_MODE environment variable (required for development):Add this to your
~/.bash_profile or ~/.zshrc to make it permanent:- Filters your development work out of usage statistics
- Enables special testing behaviors
- Must be set to a non-empty string
Install Python Dependencies
Install all required Python packages:This installs:
- Django 3.2.25 and Django REST Framework
- Morango (synchronization framework)
- Development tools (pre-commit, tox, ipdb)
- All other dependencies from
requirements/base.txt
Install Node.js and JavaScript Dependencies
Use nodeenv (installed with Python dependencies) to set up Node.js:This sets up:
- Webpack build system
- Vue.js and related frontend libraries
- Jest testing framework
- Development tools (ESLint, Prettier, etc.)
Set Up Pre-commit Hooks
Enable pre-commit hooks to ensure code quality:The hooks automatically:
- Format Python code with Black
- Format JavaScript/Vue with Prettier
- Run linters (Flake8, ESLint, Stylelint)
- Check for common errors
Initialize the Database
Create the SQLite database and run migrations:You should see output showing migrations being applied:
Start the Development Server
Launch both the Django backend and webpack frontend server:This single command:Once you see:Open your browser to http://127.0.0.1:8000/
- Starts the Django development server on port 8000
- Runs webpack in watch mode to build frontend assets
- Auto-reloads when you make code changes
The first build takes several minutes as webpack compiles all frontend assets. Subsequent rebuilds are much faster.
Import Sample Content (Optional)
To test with real educational content, import the Kolibri QA channel:In the web interface:This creates test users, classes, and assignments for development.
- Complete the setup wizard
- Navigate to Device > Channels
- Click Import with token
- Enter token:
nakav-mafak - Select resources and import (~350MB)
Verify Your Setup
To confirm everything is working:Development Workflow
Running the Dev Server
Choose the command that fits your workflow:Running Separate Servers
For backend-focused work, build frontend once then run Django alone:Testing
- Python
- JavaScript
- Linting
Common Issues and Solutions
Pre-commit hooks fail on first commit
Pre-commit hooks fail on first commit
This is expected! Pre-commit auto-fixes many issues:
- Review the changes pre-commit made
- Stage the fixed files:
git add <files> - Commit again:
git commit -m "Your message"
'Node Sass could not find a binding' error
'Node Sass could not find a binding' error
Rebuild node-sass for your current environment:
Port 8000 already in use
Port 8000 already in use
Another Kolibri instance or process is using port 8000:
Database migrations fail
Database migrations fail
Try resetting your database (development only!):
Frontend build is very slow
Frontend build is very slow
Limit which plugins are built:This significantly reduces build time and memory usage.
Next Steps
Now that you have Kolibri running:Architecture Overview
Understand Kolibri’s technical design
Contributing Guide
Learn the development workflow
Testing Guide
Write and run tests
Design System
Explore reusable UI components
Additional Resources
- Developer Docs: Full documentation at kolibri-dev.readthedocs.io
- Community Forums: community.learningequality.org
- GitHub Issues: github.com/learningequality/kolibri/issues
- Code Quality Guidelines: See
docs/code_quality.rstin the repository