All Articles

Installing Canvas learning management system

Introduction

Canvas LMS is a modern Learning Management System. It allows teachers and instructors to publish learning material online such as courses, quizzes, assignments, announcements, syllabus, modules, discussions, files, learning outcomes and more. Canvas is available as open source software and can be used free of charge.

Installation

Canvas LMS is based on Ruby on Rails framework. It uses PostgreSQL server for the database. Its installation is a bit tricky and is well described in this installation guide for production environments. The main installation steps are as follows:

  • Database installation and configuration

This involves installing PostgreSQL server and creating a database and database user that will be used to access the database. A system account with same name as the database user should be created and given superuser rights.

  • Downloading the code

This involves downloading the source code of Canvas LMS using GIT or downloading the tarball or zip file. Once the code has been downloaded it needs to be placed in the correct directory.

  • Dependency installation

    This involves installing the software required to run Canvas LMS. Canvas requires atleast Ruby v2.4 and NodeJS v6. It also requires PostgreSQL v9.3 and above. Most of Canvas dependencies are Ruby Gems. Certain NodeJs packages are also required. Ruby Gems are software packages for the Ruby language, which can be managed by the Gems package management system.

    Canvas uses the Bundler gem for managing package dependencies. Bundler may be regarded as a versioned package management system that sits on top of Gems. Bundler can be installed by entering the following command from the root of the Canvas installation:

    sudo gem install bundler --version 1.13.6

    The packages required by Canvas can then be installed using the command:

    bundle install --path vendor/bundle

    Canvas also requires certain NodeJs packages which can be installed using the Yarn package for NodeJs. Canvas prefers Yarn instead of the commonly used NPM package management system. Yarn can be installed using the commands:

    curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
    echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
    sudo apt-get update && sudo apt-get install --allow-downgrades yarn=0.27.5-1

    The NodeJs dependencies can then be installed using the command: yarn install

  • Canvas Configuration

    This steps involves copying the default configuration files to the config directory and then editing the main configuration files. The configuration files can be copied over using the following command from the installation root:

    for config in amazon_s3 database \
      delayed_jobs domain file_store outgoing_mail security external_migration; \
      do cp config/$config.yml.example config/$config.yml; done

    The next step is to edit the most important configuration files. These are the database.yml, domain.yml, security.yml and outgoing_mail.yml files.

  • Generate Assets

    Once the configuration files have been copied and edited, the next step is the generate the website assets, which are basically optimized CSS and JavaScript files. The assets can be generated using the command:

    cd {canvas_root_folder}
    mkdir -p log tmp/pids public/assets app/stylesheets/brandable_css_brands
    touch app/stylesheets/_brandable_variables_defaults_autogenerated.scss
    touch Gemfile.lock
    sudo chown -R canvasuser config/environment.rb log tmp public/assets \
                                  app/stylesheets/_brandable_variables_defaults_autogenerated.scss \
                                  app/stylesheets/brandable_css_brands Gemfile.lock config.ru
    yarn install
    RAILS_ENV=production bundle exec rake canvas:compile_assets
    sudo chown -R canvasuser public/dist/brandable_css
  • Database Population

    This step involves creating the required database tables and table indexes. It requires entering the command: RAILS_ENV=production bundle exec rake db:initial_setup. This will create the database tables, and will also prompt the user for the admin user name and password.

  • File permissions and Apache configuration

    This requires creating the system user that will own the Canvas source code files. It is usually set to the user that the Apache web server runs as. For example www-data. Once the user has been created, the file ownership needs to be changed. The next steps involves installing the Apache Passenger module.

    This is used to execute the Ruby source code. Once Passenger module has been installed, we need to create a virtual host for serving the Canvas files. After that our installation is completed and we should be able to access our Canvas installation at the URL specified in the Apache virtual host configuration file. The installation guide should be checked for the exact steps required for configuring Apache.

Features

Canvas has all the features needed for creating virtual learning environments. All learning material is contained within courses. Each course can contain learning material such as quizzes, assignments, syllabus, announcements, grades, modules, student progress and more.

The structure of Canvas is hierarchical. It consists of accounts and sub accounts. Each account and sub accounts contain courses. Each course contains quizzes, modules etc. The Canvas user guide describes all the features of Canvas.

Canvas also has a messaging feature which allows users to send messages to other Canvas users. Other features include mobiles apps, calendar for managing events and a dashboard that displays overview of each course. Canvas also has user and group management

Conclusion

Canvas is a very comprehensive and feature rich learning management system. It has been under development since 2008 and is actively supported by the open source community.

Published Nov 15, 2017

Tutorials about Web Development, Server Management, Computer Science and more