Learn how to – How To Install Canvas LMS on Ubuntu 22.04|20.04|18.04.
Welcome to our guide on how to install Canvas LMS on Ubuntu 22.04|20.04|18.04. Canvas is an open source learning management system (LMS) that has been adopted by schools, universities, and other educational institutions in delivery of online courses and to support online learning. By using Canvas, instructors are able to create and manage course materials, assignments, and assessments content online for students.
Some of the features of Canvas LMS includes:
- Availability of Mobile apps for iOS and Android devices.
- The course homepage and navigation menu are highly customizable.
- It has grading tools for lectures, readings, and other course materials
- Students can submit assignments from the portal
- Discussions forums and collaboration between students is possible
- It supports integration with third-party tools such as Turnitin and Google Drive
Canvas Software Requirements
Canvas LMS depend on the following software packages to run.
- Apache Web Server
- Ruby on Rails
- PostgreSQL database server
Here are the steps of installing and configuring the Canvas Learning Management System on Ubuntu 22.04|20.04|18.04.
Automatic Installation of Canvas LMS (Recommended)
The automatic installation method uses Docker container to run Canvas services.
Install Docker
Run below commands to install the latest release of Docker which works fine for Discourse.
wget -qO- https://get.docker.com/ | sudo sh
If you would like to use Docker as a non-root user, you should now consider adding your user to the “docker” group with:
sudo usermod -aG docker $USER
You can query for installed version using the command below.
$ docker version Client: Docker Engine - Community Version: 20.10.22 API version: 1.41 Go version: go1.18.9 Git commit: 3a2c30b Built: Thu Dec 15 22:28:08 2022 OS/Arch: linux/amd64 Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.22 API version: 1.41 (minimum version 1.12) Go version: go1.18.9 Git commit: 42c8b31 Built: Thu Dec 15 22:25:58 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.14 GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker should be in a running status.
$ systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2023-01-05 16:15:28 UTC; 33min ago TriggeredBy: ● docker.socket Docs: https://docs.docker.com Main PID: 3729 (dockerd) Tasks: 10 Memory: 1.1G CGroup: /system.slice/docker.service └─3729 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.085800033Z" level=warning msg="Your kernel does not support cgroup blkio weight_device" Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.086343753Z" level=info msg="Loading containers: start." Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.281407771Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to> Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.371426726Z" level=info msg="Loading containers: done." Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.400215239Z" level=info msg="Docker daemon" commit=42c8b31 graphdriver(s)=overlay2 version=20.10.22 Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.400833884Z" level=info msg="Daemon has completed initialization" Jan 05 16:15:28 server systemd[1]: Started Docker Application Container Engine. Jan 05 16:15:28 server dockerd[3729]: time="2023-01-05T16:15:28.455021718Z" level=info msg="API listen on /run/docker.sock" Jan 05 16:24:06 server dockerd[3729]: time="2023-01-05T16:24:06.685971360Z" level=info msg="ignoring event" container=f506b4ec36287aeb43028e5ce6ebffbca70f9f248764b4ff1ce8e7e543010326 module=libcont> Jan 05 16:24:07 server dockerd[3729]: time="2023-01-05T16:24:07.330258754Z" level=info msg="ignoring event" container=776f99c97199ca6c67160da1570c6164a1cf3bdfa61731bfe58ad11e8d9ba55e module=libcont>
Clone the repository:
git clone https://github.com/instructure/canvas-lms.git
Then run installer script.
$ cd canvas-lms
$ ./script/docker_dev_setup.sh
________ ________ ________ ___ ___ ________ ________
| ____| __ | ___ | / /| __ | ____
___| | \ / / | | ___|_
__ \ / / / __ _____
____ \ / / |____|
_______ __ __ __\ __ __/ / __ _______
|_______||__||__||__| |__||__|/ |__||__|_________
|_________|
Welcome! This script will guide you through the process of setting up a
Canvas development environment with docker and dinghy/dory.
When you git pull new changes, you can run ./scripts/docker_dev_update.sh
to bring everything up to date.
> First, we need to install some dependencies.
OK to run 'sudo apt-get update && sudo apt-get install -y docker-compose'? [y/n] y
Agree to all other prompts to finish the installation of Canvas LMS.
Manual Installation of Canvas
For manual installation of Canvas LMS on Ubuntu 22.04|20.04|18.04, use the steps below.
Step 1: Install Canvas dependencies
Here we will install Ruby and Node.js software packages. Let’s start with the installation of Node.js.
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt install nodejs
sudo npm install -g npm@latest
Supported Ruby version is on a PPA repository, add it like below.
sudo apt install software-properties-common
sudo add-apt-repository ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.7 ruby2.7-dev zlib1g-dev libxml2-dev
libsqlite3-dev postgresql libpq-dev
libxmlsec1-dev libidn11-dev curl make g++
Confirm ruby version.
$ ruby -v ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux-gnu]
Finally install Yarn.
sudo npm -g install yarn
Step 2: Install PostgreSQL database server
Canvas uses PostgreSQL to store its data. Install PostgreSQL on Ubuntu using our guide below.
Once the database server is installed, create database for Canvas and user named canvas.
sudo su postgres
createuser canvas --no-createdb --no-superuser --no-createrole --pwprompt
Provide user password and confirm when prompted. Then create canvas database.
$ createdb canvas --owner=canvas
You can optionally set your system username as a postgres superuser.
sudo -u postgres createuser $USER
sudo -u postgres psql -c "alter user $USER with superuser" postgres
Step 3: Clone Canvas LMS project
Clone the latest source for Canvas.
git clone https://github.com/instructure/canvas-lms.git /var/canvas
Checkout stable branch.
cd /var/canvas
git checkout stable
Step 4: Configure Canvas
Change to /var/canvas
directory and pull in the default configuration values.
cd /var/canvas
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
Do the same for Database and Dynamic settings.
cp config/dynamic_settings.yml.example config/dynamic_settings.yml
cp config/database.yml.example config/database.yml
Edit the file config/database.yml
and set your Canvas Database credentials.
.......... production: adapter: postgresql encoding: utf8 database: canvas host: localhost username: canvas password: password timeout: 5000
Install Bundler using Ruby Gems:
sudo gem install bundler --version 2.2.33
Install Canvas Dependencies
bundle config set --local path vendor/bundle
bundle install
yarn install --pure-lockfile && yarn install --pure-lockfile
Population database with tables and data.
bundle exec rails db:initial_setup
Sample output is as shown below.
Build a number of Canvas assets using:
bundle exec rails canvas:compile_assets
Finally start the Canvas server.
bundle exec rails server
Leave a Reply
You must be logged in to post a comment.