Discourse: Manually Configure SSL Certificates

In addition to Discourse’s built-in ACME solution, you can also manually configure an SSL certificate for Discourse using the following method:

Modify Configuration File

Navigate to the Discourse installation directory /var/discourse and edit the main containers/app.yml configuration file.

  1. Find the line templates/web.letsencrypt.ssl.template.yml and add a # comment in front of it.
  2. Find the line templates/web.ssl.template.yml and remove the leading # (add this line manually if it is not present).
  3. If the expose section below does not include - "443:443", add it manually.

Save and exit the editor once finished.

Deploy SSL Certificate

Run mkdir -p /var/discourse/shared/standalone/ssl to create the certificate directory, then create the two files ssl.crt and ssl.key respectively, fill them with your certificate’s public and private keys, and save them.

Rebuild Discourse

Once the certificate deployment is complete, run ./launcher rebuild app in the /var/discourse directory to redeploy Discourse, and it will take effect once the deployment finishes.

From 茶馆 to CMS > Discourse

discourse, ssl, #tutorial-addition

What should I do if I still can’t open the website after following this procedure?

Post your error message so we can take a look.

It’s fixed. This is not an SSL issue, the problem was caused by an extra inbound port in the server backend :hot_face: