# Minimal Email Setup for Ghost 6.0 Docker Instance on Ubuntu?

**URL:** <https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975>\
**Category:** Developer help\
**Created:** [September 1, 2025, 10:59pm UTC](https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975 "2025-09-01T22:59:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkndrkn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jkndrkn/32/37668_2.png) [@jkndrkn](https://forum.ghost.org/u/jkndrkn)\
**Post date:** [September 1, 2025, 10:59pm UTC](https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975/1 "2025-09-01T22:59:40Z")

</div>

I installed Ghost on an Ubuntu Linode 1 GB shared instance on Saturday. I installed it initially using `ghost-cli` and then migrated it to a Ghost 6.0 Docker-based install today. I am using the latest version. Now I noticed that I can’t log-in to my admin panel on a new device because email is not set up on my Linode instance and 2FA is required by default. I am aware that email is disabled on Linode by default to cut down on spam. I have opened a ticket with Linode to enable email.

Questions:

- Are there any guides written for setting up email in such a way that it will be compatible with a Docker-based Ghost install? I am not looking to set up newsletter notifications and send email blasts. I just want to be able to log in!
- Is there a sure-fire way to disable 2FA temporarily in production while I get email setup sorted?
- How do I perform maintenance operations on a Dockerized Ghost instance? Since ghost-cli is not available, how could I run, for example, `ghost doctor`? How would I back-up a Dockerized Ghost instance?
- Did I jump the gun and transition to Docker-based Ghost too soon? Should I have stayed with `ghost-cli`?

Thanks!

---

<div class="post-metadata">

**Author:** ![ghostdan](https://avatars.discourse-cdn.com/v4/letter/g/ea5d25/32.png) [@ghostdan](https://forum.ghost.org/u/ghostdan)\
**Post date:** [September 2, 2025, 12:04am UTC](https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975/2 "2025-09-02T00:04:36Z")

</div>

This post might help, last paragraph probably the quickest thing to try.

> [@Ghost 6.0.4 upgrade broke admin login..?](https://forum.ghost.org/t/ghost-6-0-4-upgrade-broke-admin-login/59672/2):
>
> Ghost introduced device verification and 2FA back in April: This requires a working mail configuration. The error message indicates that there is a mismatch in SSL versions. I have ran into this before with a weird VPS setup, though I am surprised this happens on DigitalOcean. Quick workaround: set mail.options.tls.rejectUnauthorized to false in your configuration. Better workaround: use the Mailgun API for transactional emails. DigitalOcean is starting to block standard SMTP ports, so soo…

---

<div class="post-metadata">

**Author:** ![jkndrkn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jkndrkn/32/37668_2.png) [@jkndrkn](https://forum.ghost.org/u/jkndrkn)\
**Post date:** [September 6, 2025, 10:26pm UTC](https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975/3 "2025-09-06T22:26:16Z")

</div>

I have set up a Mailgun account, configured DNS for my site to support Mailgun, created an SMTP user, and used msmtp with a `~/.msmtprc` file to verify that I can send email from that user. Email is being sent and received using msmtp.

This is my /opt/ghost/.env configuration for Dockerized Ghost:

```bash
mail__from=postmaster@example.com
mail__transport=SMTP
mail __options__ host=smtp.mailgun.org
mail __options__ port=587
mail __options__ secure=false
mail __options__ auth__user=postmaster@example.com
mail __options__ auth__pass=MY_PASSWORD

```

I pasted the values of `mail __from` and `mail__ options __auth__ pass` directly into my `msmtp` config to make sure that there are no errors. I can successfully send emails using `msmtp` with these credentials.

However, when I try to log-in to my site, 2FA is active and an attempt to send an email fails with an error. Here is the error:

```  
[2025-09-06 22:25:32] ERROR “POST /ghost/api/admin/session” 500 359ms

Failed to send email. Please check your site configuration and try again.

“Please see [Configuration - Ghost Developer Docs](https://ghost.org/docs/config/#mail) for instructions on configuring email.”

Error ID:  
66dec980-8b70-11f0-bff3-bb84e614fc69

* * *

EmailError: Failed to send email. Please check your site configuration and try again.  
at Object.sendAuthCodeToUser (/var/lib/ghost/versions/6.0.7/core/server/services/auth/session/session-service.js:284:19)  
at process.processTicksAndRejections (node:internal/process/task\_queues:105:5)  
at async Object.createSession (/var/lib/ghost/versions/6.0.7/core/server/services/auth/session/middleware.js:16:17)  
```

Note that I have tried using the following configuration as well:

```auto
mail __options__ port=465
mail __options__ secure=true

```

This fails as well.

---

<div class="post-metadata">

**Author:** ![jkndrkn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jkndrkn/32/37668_2.png) [@jkndrkn](https://forum.ghost.org/u/jkndrkn)\
**Post date:** [September 6, 2025, 10:37pm UTC](https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975/4 "2025-09-06T22:37:18Z")

</div>

I just tried to ssh into my Ghost docker container:

```auto
sudo docker exec -it ghost-ghost-1 bash

```

I installed msmtp there and copied my .msmtprc file into /root/.msmtprcI was able to successfully send and receive an email using msmtp from inside my Ghost Docker container.

---

<div class="post-metadata">

**Author:** ![jkndrkn](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jkndrkn/32/37668_2.png) [@jkndrkn](https://forum.ghost.org/u/jkndrkn)\
**Post date:** [September 6, 2025, 10:47pm UTC](https://forum.ghost.org/t/minimal-email-setup-for-ghost-6-0-docker-instance-on-ubuntu/59975/5 "2025-09-06T22:47:22Z")

</div>

Finally figured it out!

When I imported my initial `ghost-cli` install the following got appended to the end of my .env file:

```auto
mail__transport=Direct

```

This overwrote the `mail__transport=SMTP` setting further up in my `.env` file and it broke my email configuration. I deleted this extra line of configuration and 2FA emails are working correctly now!
