This guide walks through a self-hosted installation of Canvas LMS. Canvas LMS can be deployed using multiple approaches depending on your infrastructure requirements and operational preferences.
⚠️ Important: Canvas LMS has complex dependencies. For production environments, consider using the traditional installation method or validated Docker images rather than building from source.
Update your system packages and install dependencies:
# For Ubuntu/Debian
sudo apt update && sudo apt upgrade -y
sudo apt install -y build-essential libxml2-dev libxslt1-dev libcurl4-openssl-dev \
libreadline-dev libssl-dev libpq-dev postgresql-client redis-server \
nodejs npm imagemagick ffmpeg git-core
# For RHEL/CentOS
sudo dnf update -y
sudo dnf install -y gcc gcc-c++ make libxml2-devel libxslt-devel curl-devel \
readline-devel openssl-devel postgresql-devel nodejs npm \
ImageMagick ffmpeg git-core
Canvas LMS requires Ruby 3.0+. Install using rbenv or RVM:
# Using rbenv
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
# Install Ruby build plugin
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# Install Ruby 3.1+ (check Canvas requirements for latest supported version)
rbenv install 3.1.4
rbenv global 3.1.4
Choose the appropriate branch for your needs:
# For production - use stable branch
git clone -b stable https://github.com/instructure/canvas-lms.git canvas-lms
cd canvas-lms
# For latest features (not recommended for production)
# git clone -b master https://github.com/instructure/canvas-lms.git canvas-lms
# cd canvas-lms
gem install bundler
bundle install
💡 Note: The official Docker images for Canvas LMS may not always be up-to-date. Building from source using Docker is often necessary for current versions.
# Install Docker and Docker Compose
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo usermod -aG docker $USER
git clone -b stable https://github.com/instructure/canvas-lms.git canvas-lms
cd canvas-lms
Create a .env file with your configuration:
# Example .env file
CANVAS_LMS_DOMAIN=your-domain.com
CANVAS_LMS_ADMIN_EMAIL=admin@your-domain.com
POSTGRES_USER=canvas
POSTGRES_PASSWORD=your_secure_password
POSTGRES_DB=canvas_production
REDIS_URL=redis://redis:6379/0
SECRET_KEY_BASE=your_secret_key_here
# Build the Docker image (this may take considerable time)
docker build -t canvas-lms .
# Or use docker-compose if available
docker-compose up -d
For automated deployments across multiple servers, see Canvas LMS Ansible Setup.
Configure your database connection and run migrations:
# For traditional installation
bundle exec rake db:initial_setup
# For Docker, this is typically handled by the container initialization
Compile static assets for production:
bundle exec rake canvas:compile_assets
Start Canvas LMS services:
# Traditional installation
bundle exec rails server -d
# Or using a process manager like systemd
sudo systemctl enable canvas-lms
sudo systemctl start canvas-lms
Prefer containers? See Canvas LMS Docker Setup.
# Check Canvas LMS status
bundle exec rake canvas:compile_assets --dry-run
# Verify configuration
bundle exec rake canvas:check_external_dependencies
# Run tests to verify installation
bundle exec rspec spec/
Any questions?
Feel free to contact us. Find all contact information on our contact page.