Use a self-signed cert with Discourse for emails

Using a self-signed certificate with your SMTP and POP mail in Discourse is easy once you know how - here’s how!

There is a condition, and that is that your hostname (main domain for server - usually the domain used for your name servers) allows your other domains to check email through it (usually via Most hosting panels allow this.


  • First create your self-signed certificate - just make sure your ‘web server hostname’ does not have http or www (so something like

  • Then upload the certificate (not the key!) to somewhere on your server, such as

  • Then add the following code to your app.yml:

 - file:
     path: /tmp/add-cert
     chmod: +x
     contents: |
       #!/bin/bash -e
       #Download cert
       wget  -O - > /usr/local/share/ca-certificates/your-email-cert.crt

 - exec: "/tmp/add-cert"

(Change to match your details)

  • Then ./launcher rebuild app to rebuild your app.

  • Then in your admin control panel, make sure the pop3 polling host setting is just the hostname (so not, just

That’s it!!

If you need to trouble shoot:

./launcher enter app

Then cd /etc/ssl/certs and make sure your crt is there.

Thanks to @riking for all his help in this :slight_smile: