All Articles

How to Set Up Canvas LMS on AWS

Introduction: Scalable and Robust LMS Hosting

Canvas LMS is a popular learning management system (LMS) used by educational institutions worldwide. Deploying Canvas LMS on AWS provides scalability, flexibility, and reliability. This guide will walk you through the essential steps for setting up Canvas LMS on AWS.

Step-by-Step Setup

Step 1: Prepare the AWS Environment

  1. Select the AWS Region:

    • Choose a region that is closest to your users for low latency. For example, use us-east-1 if most users are in the US.
  2. Create an EC2 Instance:

    • In the AWS Console, navigate to EC2 and create a new instance.
    • Choose an Ubuntu or Amazon Linux AMI and select an instance size based on your traffic needs. For initial testing, a t3.medium instance is recommended.
    • Configure Security Groups to allow traffic on ports 80 (HTTP) and 443 (HTTPS).
  3. Set Up a Relational Database:

    • Go to RDS and create a new PostgreSQL database instance.
    • Choose a Multi-AZ deployment for production-level reliability. Allocate a size based on expected data requirements.

Step 2: Install and Configure Canvas LMS

  1. Connect to EC2 via SSH:

    • Connect to your instance using an SSH client. Run the following command:
      ssh -i /path/to/your-key.pem ubuntu@ec2-your-public-ip.amazonaws.com
  2. Install Required Dependencies:

    • Update your package list and install dependencies:
      sudo apt update
      sudo apt install -y git curl nodejs postgresql libpq-dev
  3. Clone the Canvas LMS Repository:

    • Clone the Canvas LMS source code from GitHub:
      git clone https://github.com/instructure/canvas-lms.git
      cd canvas-lms
  4. Configure Database and Environment:

    • Set up the config/database.yml file with your RDS PostgreSQL connection details.
    • Create a .env file to configure application-specific settings like domain name, SSL, and email settings.
  5. Install Bundler and Required Gems:

    • Run the following commands to install Ruby dependencies:
      gem install bundler
      bundle install

Step 3: Set Up Web Server and SSL

  1. Install and Configure Nginx:
    • Install Nginx as your reverse proxy server:
      sudo apt install nginx
  2. Configure SSL using Let’s Encrypt:
    • Set up SSL certificates using Let’s Encrypt:
      sudo apt install certbot python3-certbot-nginx
      sudo certbot --nginx -d yourdomain.com
  3. Set Up Nginx Configuration:
    • Configure Nginx to proxy requests to Canvas LMS. Use a sample configuration file that includes your domain and SSL paths.

Step 4: Initialize Canvas LMS and Start Services

  1. Run Database Migrations:

    • Initialize the database with the following command: bundle exec rake db:migrate
  2. Precompile Assets:

    • Precompile assets to optimize performance: bundle exec rake canvas:compile_assets
  3. Start the Application:

    • Start Canvas LMS services using a process manager like PM2 or systemd.

Conclusion: Scalable Canvas LMS Hosting on AWS

By setting up Canvas LMS on AWS, you gain control over your infrastructure, enabling scalability, security, and flexibility for managing online education effectively. Follow these steps and tailor the configuration based on your institution’s requirements.

Published Oct 31, 2024

Welcome to Vians Tech