Canvas by Instructure is the most popular LMS in U.S. Higher Education today. It has excelled at grabbing the upper income tranche of the market. But even if you do not belong at the American top, you can still find out what all the fuss is about. The following guide will show you how you can set up the Canvas LMS for free on your server.
Canvas LMS: Free as in AGPLv3The Canvas LMS software is Open Source. The AGPLv3 license it is under allows users to collaborate in software hosted on a cloud. Users of AGPLv3 licensed software must make any work based on it public and free. You cannot sell it, but you can sell products or offer services supported by the software. Including online courses, of course. Instructure does not release 100% of Canvas code, so you might not get the exact same experience as in signing on as a customer.
Before you start: Asset inventory checklistMake sure you have all the ingredients before you get started on setting up your own Canvas LMS. Let’s begin with some helpful tools and associated skills:
- Apache HTTP Server
- The Ruby programing language (version 2.4.0 or newer) and the Rails framework
- Optional (But highly encouraged):
- Git (Version Control Software)
- PostgreSQL (Database)
- Passenger (Web server application) and the library for Apache
- Server virtualization. Also a Docker or Virtual Machine, it is becoming standard practice for developer of server-side applications
- Redis 2.6 or newer (Cache management). The guide warns that the version Ubuntu install might not be the latest
- The latest version of Canvas LMS. You can get it using Git (instructions here) or downloading and extracting the files in a compressed package: TARBALL (for Linux or Unix systems) or ZIP (everyone)
- A server running Linux. The latest Debian or Ubuntu Server distributions are recommended. If you have a server running Windows or a different system, you will need to set up a Virtual Machine
- Ruby on Rails. In addition, other dependencies are listed throughout the guide, but they seem fairly easy to install. They include Ruby Gems and Bundler
- PostgreSQL database engine. In principle an instance of the vastly more popular, open source MySQL engine should work, but in 2014 Instructure dropped support arguing the move to Rails 3. There is nothing preventing Rails 3 from working with a MySQL databate. In fact, here is a 2013 guide about how to do it.
- An outgoing SMTP email server service.
- An SSL certificate.
The ‘quick start’ and the ‘production’ Canvas LMS guidesIf you want to just check Canvas out and play around, Instructure offers many ways to get it done. They are, in order of simplicity:
- Canvas Cloud for Teachers. A freemium, cloud-based site for teachers, where you don’t have to set up anything nor touch any code. It also lets you export your work into a production Canvas site.
- Use Docker to launch an “Automated Setup.” Place this SH file on your virtual environment and run it to do all the work for you. Learn more.
- Manual setup. A more hands-on approach, but where you are told how to customized everything, and includes some sample files to get started. It is significantly limited and will not work as a production LMS.
Setting up a production Canvas LMS
Server configuration selectionOne of the first examples of conflictin information in the production guide is the server configuration step. At different parts of the guide it suggests either a one or two-server setup. You can choose the number of servers that will run Canvas, and which applications will use which server. The best recommendation at this point seems to be three servers with 8GB RAM each. Keeping the database and Canvas LMS running in the same server seems to be okay, but the official recommendation is to keep “memory-hungry” components separate, as in the case of Redis, daemon (automated background tasks) and the Canvas Rails app itself. A fourth server could be recommended for the Apache server app. Altough it seems there it no need for a server just for Apache, it is not clear which of the other three could share resources with it. Choosing different servers will have implications going forward:
- The database must accept “foreign” connections (incoming from another server). This requires editing the database configuration files.
- If you are using a Virtual Machine, you might need to disable concurrent instances running in the step of linking the Canvas app with the Apache server.
Installing and configuring supporting softwareYou will need to install the following software, and then integrate one another:
- Ruby, its libraries and packages, and Rails. They begin here with Ruby Gems, which manages Ruby libraries (“Gems”), followed by Bundler, and continuing throughout the guide.
- The database. Instructure recommends PostgreSQL 9.5 or newer, on which the production guide is based. Install the database and create a “Canvas” user (name and password). Later on you will give Canvas the user info to let them create and udpate the tables.
- Apache and Passenger, including the Passenger + Apache library. The documentation to link the two to Rails is on a link currently not opening. Lighter instructions are here.
- SSL for Apache. This process can vary widely with the choices of free and paid SSL certificates available.
- Canvas for Apache + Passenger. The process involes linking a single “virtual instance” (on Apache, VirtualHosts) to Canvas and editing a
canvas.conffile with your server and SSL information.
Locating and installing Canvas LMSFind a reasonable directory address in your server to upload the unpacked files of Canvas. The guide suggests
/var/canvasThe files included on the package come with lots of preconfigured settings. Depending on your needs and context, you will need to find each file and locate them. Most of the configuration files have a YML extension and are on the
Initializing Canvas LMS options
- The database: Find the
config/database.ymland add the Canvas user database credentials you created earlier.
- Outgoing mail. Fint
config/outgoing_mail.ymland update it with your SMTP server information. Learn more.
- The domain of the website, on
- Security: Random hashing at
- Automated jobs: Canvas uses a daemon process, a common name for applications tha run in the background and
Generating assets and populating databasesCanvas will automatically build a number of “assets” before it works correctly on its first launch. You need to build the directories manually, however. The list of directories is here. Following the asset creation, the database will initialize with baseline data provided by Canvas. By running the initial setup executable, the console will prompt you for a series of “environment variables” and permissions. You will also be asked whether you want Canvas to send your LMS data to Instructure for analysis and monitoring.
Security: Canvas LMS ownership and rolesOnce the initial setup is complete, edit the roles to make sure that your Canvas LMS site cannot be configured from outside, nor that Canvas can edit things on the server beyond its purview.
- Like on the database step, Create a unique Canvas user for Rails and limit its ownership.
- For all the YML files on the
configfolder, make it so only the Rails Canvas user you create can view and modify them.
First Canvas LMS launchThe final step should be to restart the Apache app:
sudo /etc/init.d/apache2 restartThen, open your browser on the Canvas installation (mind the domain). You will be prompted for the Database admin credentials. Log in and follow the screen. You should be able to run a blank Canvas.