Docker How to: Set up ownCloud with Traefik for Let’s Encrypt SSL

The second part of our Docker how-to series treats advanced setups with Traefik as a reverse proxy. Learn more about devops and how to integrate other services into your setup!


Hello, as a docker newbe I followed the “Docker Series Pt.2” to setup my own ownCloud server on a Ubuntu 18.04 host VPS.

I really appreciate the document and get it up and running, except one issue:

Everything works fine, except that ownCloud can’t send emails. With that I mean, when I create a new user in ownCloud and try to set the password I get a message “Couldn’t set reset email” (or something similar).

I assumed that I have to setup a mailserver myself and tried to experiment with postfix. And this is maybe my first question. Is this a right assumption or should it work right out of the box?

First I tried to install postfix on my host OS but I was not able to tell the ownCloud container to use that install.

Second I tried to install postfix (and mailutils) on the owncloud container. This is a partial succes, I was able to send email from owncloud, being it unencrypted. However, from the docker documentation I am reading it seems not a clean solution to solve this in the container.

Can someone give me some pointers on where to install the mail server (host VPS, one of the containers in the how-to manual, or a new container), and also how I can let ownCloud use this email server?

For the love of god :smiley: I would not recommend to run a mail server just to send system mails, let alone inside a docker container.

The solution you are looking for is far easier. Just use an existing email account. In the ownCloud admin settings in the web interface, you can enter the credentials to that email account. You can find the settings at, where is your domain.

If your ownCloud admin user has an email address associated with its account, you can also test the email directly, by sending a test email from the ownCloud web interface. If that doesn’t work, you might need to set your email address at

Personally, I haven’t seen a mail server running in docker yet, although it’s probably possible. But Docker best practices say that each process should get its own container, and running something as complicated as postfix in a container dedicated to something as complex as ownCloud… is at least not recommended.

1 Like

Thank you very much for your answer. I just missed the whole idea of using an existing smtp server located somewhere else.

Below is how I solved a new issue and how I set thing up. Possibly trivial for an admin but hopefully useful for a newbe like me.

First I rolled back to the original docker image mentioned in the howto without making any modifications in the container.

I decided to use For my gmail account I additionally had to allow access for less secure applications. So, I followed this manual to do so

Below is the configuration I made in ownCloud, with mydomain replaced my the ownCloud domain and user replaced by the gmail username.