Instructure's Canvas LMS is a popular open-source learning management system that offers a variety of tools and features to educators for online teaching and learning. In this tutorial, we will be learning how to install Canvas on an Ubuntu server.
Before we begin installing Canvas, we need to update and upgrade the Ubuntu server with the latest patches and packages. To do this, open a terminal window and execute the following command:
sudo apt update && sudo apt upgrade -y
To install Canvas, we need to install a few packages that are required for its smooth installation and operation. Execute the following command to install them:
sudo apt install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs npm yarn imagemagick postfix
Canvas requires Ruby 2.7.2 to run properly. We will install it by adding the Brightbox PPA repository, updating our package lists, and then installing it via apt. Execute the following commands one by one:
sudo apt-add-repository -y ppa:brightbox/ruby-ng
sudo apt update
sudo apt install ruby2.7 ruby2.7-dev
Now that we have all the necessary packages and software installed on our server, we can clone the Canvas LMS repository using Git. Execute the following command to clone the latest version of Canvas LMS:
git clone https://github.com/instructure/canvas-lms.git
cd canvas-lms
Navigate to the root directory of the cloned Canvas LMS project and execute the following commands:
bundle config set system 'true'
bundle install --path vendor/bundle --without=sqlite
This will install all the necessary gems and dependencies that are required for Canvas to run.
Now that we have installed Canvas LMS, we need to configure it to work with our Ubuntu server. Execute the following command to generate the configuration files:
cp config/environments/example.rb config/environments/development.rb
Then, we need to edit the development.rb file to include our database configuration. Execute the following command to edit the file:
nano config/database.yml
In the file, look for the section development: &default
and replace it with the following:
development:
adapter: postgresql
encoding: unicode
database: canvas_development
pool: 5
username: canvas
password: canvas
host: localhost
port: 5432
Save and exit the file by pressing CTRL + X
and then Y
.
Canvas requires a PostgreSQL database to store its data. To create a new database, execute the following commands:
sudo -u postgres createuser canvas -D -A
sudo -u postgres createdb canvas_development
sudo -u postgres psql -c "ALTER USER canvas WITH PASSWORD 'canvas';"
Before starting the canvas server, we need to compile its assets using the following command:
bundle exec rake canvas:compile_assets
Finally, we can start the Canvas server by executing the following command:
bundle exec rails server -p 3000
Canvas should now be up and running. To access it, launch a web browser and go to http://localhost:3000
.
Congratulations! You have successfully installed and configured the Canvas LMS on an Ubuntu server.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!