Report this

What is the reason for this report?

Cannot connect Canvas LMS to Postgres

Posted on September 26, 2021

Hi guys,

I’m hosting Canvas LMS by a droplet and want to manage our DB by Digital Ocean Postgres managed DB. However, in Canvas LMS setting, there is no option for SSL mode and Postgres from DO also does not give an option to turn off SSL mode. If you have any solution for this, please help.

This is the example of Canvas LMS database connection setting: https://github.com/instructure/canvas-lms/blob/master/config/database.yml.example

Thank you in advance.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

Heya,

Unfortunately, at this time, DigitalOcean Managed Databases do require SSL for connections and there is currently no option to disable it. Therefore, to connect Canvas LMS to a DigitalOcean Managed Database, you’d need a way to connect with SSL from Canvas.

However, it’s essential to know that although the ‘database.yml’ file for Canvas LMS doesn’t seem to include an option for SSL mode, you could add additional parameters in the database.yml file. For example:

  1. production:
  2. adapter: postgresql_
  3. encoding: unicode
  4. database: mydatabase
  5. username: myusername
  6. password: mypassword
  7. host: localhost
  8. sslmode: require
  9. port: 5432

The sslmode: require_ line is the key one. When this option is set to require, the connection will fail if SSL is not available.

If you need further assistance, DigitalOcean’s documentation is a valuable resource. Check out this link for more information on how to connect to a PostgreSQL database on DigitalOcean.

Hope that this helps!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.