Self-Hosting Canvas LMS with Docker Compose

What Is Canvas LMS?

Canvas LMS is an open-source learning management system built by Instructure, the same company behind the cloud-hosted Canvas used by thousands of universities. Self-hosting Canvas gives you the same assignment management, grading, discussions, and course tools — on your own infrastructure with no per-user fees. It replaces Google Classroom, Blackboard, and Moodle Cloud. Official repo.

Updated March 2026: Verified with latest Docker images and configurations.

Prerequisites

  • A Linux server (Ubuntu 22.04+ recommended)
  • Docker and Docker Compose installed (guide)
  • 8 GB of free RAM (minimum)
  • 4+ CPU cores recommended
  • 150 GB of free disk space
  • A domain name (recommended for production)

Docker Compose Configuration

Create a docker-compose.yml file:

services:
  canvas-web:
    image: instructure/canvas-lms:stable
    container_name: canvas-web
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      RAILS_ENV: production
      CANVAS_LMS_ADMIN_EMAIL: [email protected]
      CANVAS_LMS_ADMIN_PASSWORD: changeme_strong_password
      CANVAS_LMS_ACCOUNT_NAME: "My School"
      CANVAS_LMS_STATS_COLLECTION: opt_out
      POSTGRES_HOST: canvas-db
      POSTGRES_USER: canvas
      POSTGRES_PASSWORD: canvasdbpass
      REDIS_URL: redis://canvas-redis:6379/1
      ENCRYPTION_KEY: your_32_char_encryption_key_here
    volumes:
      - canvas-files:/usr/src/app/tmp/files
      - canvas-uploads:/usr/src/app/public/uploads
    depends_on:
      canvas-db:
        condition: service_healthy
      canvas-redis:
        condition: service_healthy

  canvas-jobs:
    image: instructure/canvas-lms:stable
    container_name: canvas-jobs
    restart: unless-stopped
    command: bundle exec script/delayed_job run
    environment:
      RAILS_ENV: production
      POSTGRES_HOST: canvas-db
      POSTGRES_USER: canvas
      POSTGRES_PASSWORD: canvasdbpass
      REDIS_URL: redis://canvas-redis:6379/1
      ENCRYPTION_KEY: your_32_char_encryption_key_here
    depends_on:
      canvas-db:
        condition: service_healthy
      canvas-redis:
        condition: service_healthy

  canvas-db:
    image: postgres:16-alpine
    container_name: canvas-db
    restart: unless-stopped
    environment:
      POSTGRES_USER: canvas
      POSTGRES_PASSWORD: canvasdbpass
      POSTGRES_DB: canvas_production
    volumes:
      - canvas-db-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U canvas -d canvas_production"]
      interval: 10s
      timeout: 5s
      retries: 5

  canvas-redis:
    image: redis:7.4-alpine
    container_name: canvas-redis
    restart: unless-stopped
    volumes:
      - canvas-redis-data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  canvas-files:
  canvas-uploads:
  canvas-db-data:
  canvas-redis-data:

Generate an encryption key before starting:

openssl rand -hex 16
# Use this 32-character output as ENCRYPTION_KEY

Start the stack:

docker compose up -d

The first start takes several minutes as Canvas runs database migrations and compiles assets.

Initial Setup

  1. Wait for Canvas to finish initializing: docker compose logs -f canvas-web
  2. Open http://your-server-ip:3000 in your browser
  3. Log in with the admin credentials you set in CANVAS_LMS_ADMIN_EMAIL and CANVAS_LMS_ADMIN_PASSWORD
  4. Navigate to AdminCourses to create your first course

Create a Course

  1. Go to AdminCoursesAdd a New Course
  2. Enter course name and term
  3. Add modules, assignments, quizzes, and discussions
  4. Invite students via email or self-enrollment link

Configuration

Key Environment Variables

VariableRequiredDescription
RAILS_ENVYesSet to production
POSTGRES_HOSTYesPostgreSQL hostname
POSTGRES_USERYesDatabase username
POSTGRES_PASSWORDYesDatabase password
REDIS_URLYesRedis connection URL
ENCRYPTION_KEYYes32-character hex key for data encryption
CANVAS_LMS_ADMIN_EMAILYesInitial admin email
CANVAS_LMS_ADMIN_PASSWORDYesInitial admin password
CANVAS_LMS_ACCOUNT_NAMENoOrganization name
CANVAS_LMS_STATS_COLLECTIONNoSet opt_out to disable telemetry

SMTP Configuration

For email notifications (assignment reminders, grading alerts):

environment:
  SMTP_ADDRESS: smtp.example.com
  SMTP_PORT: "587"
  SMTP_USER: [email protected]
  SMTP_PASSWORD: your_smtp_password
  SMTP_AUTHENTICATION: login
  SMTP_ENABLE_STARTTLS_AUTO: "true"

File Storage

Canvas stores uploaded files in /usr/src/app/tmp/files. For large deployments, mount external storage:

volumes:
  - /mnt/storage/canvas-files:/usr/src/app/tmp/files

Reverse Proxy

Place behind Nginx Proxy Manager or Caddy for HTTPS. Canvas requires proper domain configuration for SSO and LTI integrations. See Reverse Proxy Setup.

Backup

Back up the PostgreSQL database and file storage:

# Database
docker exec canvas-db pg_dump -U canvas canvas_production > canvas-backup-$(date +%Y%m%d).sql

# Files
tar czf canvas-files-$(date +%Y%m%d).tar.gz -C /var/lib/docker/volumes/ canvas-files canvas-uploads

See Backup Strategy.

Troubleshooting

Canvas Stuck on “Initializing”

Symptom: Web interface shows loading screen for more than 10 minutes. Fix: Check logs: docker compose logs canvas-web. Common cause: database migrations failing due to insufficient RAM. Ensure 8 GB+ RAM is available. Check PostgreSQL is healthy: docker compose ps.

Background Jobs Not Processing

Symptom: Emails not sending, grade calculations delayed. Fix: Verify the canvas-jobs container is running: docker compose ps. Check its logs for errors. The jobs container must have identical environment variables as the web container.

Asset Compilation Errors

Symptom: Missing CSS/JS, broken UI after deployment. Fix: Run asset compilation manually: docker exec canvas-web bundle exec rake canvas:compile_assets. This is resource-intensive — ensure sufficient RAM and CPU.

Resource Requirements

  • RAM: 4 GB minimum for web + jobs, 8 GB recommended
  • CPU: 2 cores minimum, 4 cores recommended
  • Disk: 10 GB for application, 50+ GB for course files and uploads

Verdict

Canvas LMS is the most feature-complete open-source LMS available. If you need university-grade course management — assignments with rubrics, SpeedGrader, discussion boards, quizzes with question banks, LTI integration — Canvas delivers. The trade-off is resource requirements: it needs 8 GB RAM and significant disk space. For smaller setups or simpler course delivery, Moodle is lighter and easier to self-host. For online course sales (Teachable/Udemy replacement), neither is ideal — look at dedicated course platforms.

Frequently Asked Questions

Is the self-hosted Canvas LMS the same as the commercial version?

Mostly. Canvas LMS is open source (AGPLv3) and the core platform is the same code that Instructure offers as a hosted service. However, some features like the Catalog module, certain LTI integrations, and premium support are only available in the paid hosted version. The self-hosted community edition covers courses, assignments, quizzes, discussions, grading, and the core LMS features.

How much RAM does Canvas LMS actually need?

Minimum 4 GB for a functional installation, but 8 GB is strongly recommended. Canvas runs multiple Ruby on Rails processes plus background job workers, and PostgreSQL and Redis add to the memory footprint. With fewer than 50 concurrent users, 8 GB works. For 100+ users, plan for 16 GB and consider separating the database onto its own server.

Can Canvas LMS integrate with video conferencing?

Yes. Canvas supports LTI (Learning Tools Interoperability) integrations with Zoom, BigBlueButton, Microsoft Teams, and other conferencing tools. BigBlueButton is the most popular self-hosted option — it integrates directly with Canvas through the LTI standard, allowing students to join meetings from within courses.

Does Canvas support SCORM content?

Yes. Canvas can import and run SCORM 1.2 and SCORM 2004 content packages. Upload the SCORM zip file as an assignment, and Canvas handles launching the content and recording completion/scores. This makes it compatible with most commercial e-learning content.

Can I migrate from Moodle to Canvas?

Canvas supports importing Moodle backup files (.mbz) through its content migration tool. Course structure, content pages, assignments, and quizzes transfer over, though some formatting may need adjustment. Question banks and complex quiz types may require manual recreation. Test the migration with a non-critical course first.

Is Canvas LMS suitable for small training teams?

Canvas works but is heavyweight for small setups. If you’re training 5-20 people, the 8 GB RAM requirement and multi-service architecture are overkill. Moodle runs on less hardware and has a simpler setup. Canvas justifies its resource requirements when you need advanced features like SpeedGrader, rubrics, and LTI integrations at scale.

Comments