Brief: In this quick tutorial I’ll show you how to change the SMTP details in Discourse installed using Digital Ocean’s one-click script. The tutorial should also be valid for any Discourse installed in containers.
Digital Ocean allows you to quickly setup Discourse with its one-click install scripts. Basically, you set up a new droplet preconfigured with Discourse hosting. If you do that, you’ll be asked to provide SMTP details.
SMTP is an important part of Discourse. This enables your Discourse application to send emails for new user creation, password reset, post replies and email digests.
If you provided incorrect SMTP settings or if you want to change the SMTP service, you can do that even after you have installed Discourse. It’s a simple procedure to change the SMTP settings in Discourse.
Change SMTP Settings in Discourse
Let’s see how can you change the SMTP details of your Discourse install.
First, connect to your server through SSH. If you are using Digital Ocean, you can get the IP address of your Droplet (server) from your account dashboard. I believe that you have setup SSH access for your machine here.
Once you have logged into your server, you can find the SMTP settings in
Open the app.yml file and look for SMTP settings. Normally, it looks like this:
I advise making a backup of at least your app.yml file before doing any edits. You can edit the app.yml file using a terminal editor of your choice like Vim or Nano.
While editing, keep in mind that there must be a space before and after the colon (:).
Once you have edited the app.yml with the new SMTP settings, save it and come out to
/var/discourse and run the launcher file like this:
./launcher rebuild app
It takes some time in rebuilding the app. Once the rebuilding process finishes, you should have the new settings in place. You can verify it by sending a test email and checking it in the dashboard of your SMTP service provider.
I hope this quick tutorial helped you to change your SMTP settings in Discourse. Feel free to ask your questions or provide suggestions, if you have any.