# Cannot login to ghost admin. "There was a problem on the server." message appears

**URL:** <https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094>\
**Category:** Developer help\
**Created:** [April 25, 2025, 9:01am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094 "2025-04-25T09:01:39Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tingler](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tingler/32/35845_2.png) [@Tingler](https://forum.ghost.org/u/Tingler)\
**Post date:** [April 25, 2025, 9:01am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/1 "2025-04-25T09:01:39Z")

</div>

It’s hosted on Digital Ocean. In config.production.json I have such thing

},  
“mail”: {  
“transport”: “Direct”  
},  
“logging”: {  
“transports”: [  
“file”,  
“stdout”  
]  
},  
“process”: “systemd”,  
“paths”: {  
“contentPath”: “/var/www/ghost/content”  
}  
}

After upgrade’ing Ghost to version 5.118.0 I cannot login to Ghost admin.  
Probobably this is because I used the toogle for MFA. My ghost doesn’t use any email collecting features, newsletters. It’s just blog with a single post so far. It doesn’t allow me where I logged out and tried logging again. However I have other browsers where I am still logged in and there I can still use admin panel. However once logged out I would not be able to log back in.

When I cannot login it only shows red bar at the top sayin “There was a problem on the server”.

---

<div class="post-metadata">

**Author:** ![jannis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jannis/32/39718_2.png) [@jannis](https://forum.ghost.org/u/jannis)\
**Post date:** [April 25, 2025, 9:09am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/2 "2025-04-25T09:09:49Z")

</div>

Ghost is using device verification now:

> **[Device verification & email 2FA](https://ghost.org/changelog/2fa/)**
>
> Security improvements for staff user authentication

For that to work, you’ll need to set up configuration for transactional email sending – that is separate from newsletter setup with Mailgun:

> **[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/#mail)**
>
> Find out how to configure your Ghost publication or override Ghost's default behaviour with robust config options, including mail, storage, scheduling and more!

Once you’ve done that, you’ll receive the tokens to log in.

As an alternative – though I have not tested that – you could downgrade to a previous version of Ghost, that does not implement the device verification.

---

<div class="post-metadata">

**Author:** ![Tingler](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tingler/32/35845_2.png) [@Tingler](https://forum.ghost.org/u/Tingler)\
**Post date:** [April 25, 2025, 9:57am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/3 "2025-04-25T09:57:37Z")

</div>

Would it really solve my problem, as currently I have 2FA turned off and the issue occurs even without prompting me for any code or stuff like that?  
There is this bar about server issue at the top just at the step of putting email and password to login.

---

<div class="post-metadata">

**Author:** ![jannis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jannis/32/39718_2.png) [@jannis](https://forum.ghost.org/u/jannis)\
**Post date:** [April 25, 2025, 10:01am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/4 "2025-04-25T10:01:00Z")

</div>

That would be my assumption. The device verification is different than the new 2FA (which would happen on every login).

To be sure, just check your server logs. What does it say there?

---

<div class="post-metadata">

**Author:** ![Tingler](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tingler/32/35845_2.png) [@Tingler](https://forum.ghost.org/u/Tingler)\
**Post date:** [April 25, 2025, 10:37am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/5 "2025-04-25T10:37:36Z")

</div>

Would you be able to guide me where to collect these logs?

Can I go back just to login with email and password?

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/a/4/a45fd0e36a2f617f5b9b90615f3cc6116f6cdadd.png)

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [April 25, 2025, 10:52am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/6 "2025-04-25T10:52:00Z")

</div>

That slider affects (when I asked a couple weeks ago) whether 2FA requirements happen on every login, or just first logins from devices. It doesn’t actually turn 2FA off entirely.

Your Ghost logs may be in (ghost directory)/content/logs. It depends a bit on server configuration, but I’d start there.

Setting up outbound email can be pretty easy. You can set up Mailgun in config.production.json. If you’re going to use Mailgun SMTP (which is what the docs show), you’ll need port 2525 on Digital Ocean - they’ve got more common ports blocked. Or you can use the Mailgun API for transactional email also – see here: [Missing documentation for mail config options – Mailgun API support](https://forum.ghost.org/t/missing-documentation-for-mail-config-options-mailgun-api-support/56481). If you’ve already got a Mailgun account, it should be a 10 minute job.

---

<div class="post-metadata">

**Author:** ![Tingler](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tingler/32/35845_2.png) [@Tingler](https://forum.ghost.org/u/Tingler)\
**Post date:** [April 28, 2025, 12:37am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/7 "2025-04-28T00:37:00Z")

</div>

This is what `ghost log -f` outputs from the moment of `ghost restart` to trying to login to as admin

```bash
[2025-04-28 00:29:55] INFO Your site is now available on https://piotrowskiadam.pl/
[2025-04-28 00:29:55] INFO Ctrl+C to shut down
[2025-04-28 00:29:55] INFO Ghost server started in 0.454s
[2025-04-28 00:29:55] INFO Bootstrap client was closed.
[2025-04-28 00:29:55] INFO Database is in a ready state.
[2025-04-28 00:29:55] INFO Ghost database ready in 0.724s
[2025-04-28 00:29:55] WARN Missing mail.from config, falling back to a generated email address. Please update your config file and set a valid from address
[2025-04-28 00:29:56] INFO Invalidating assets for regeneration
[2025-04-28 00:29:57] INFO Adding offloaded job to the inline job queue
[2025-04-28 00:29:57] INFO Scheduling job mentions-email-report at 45 11 * * * *. Next run on: Mon Apr 28 2025 01:11:45 GMT+0000 (Coordinated Universal Time)
[2025-04-28 00:29:57] INFO Adding offloaded job to the inline job queue
[2025-04-28 00:29:57] INFO Scheduling job clean-expired-comped at 52 17 4 * * *. Next run on: Mon Apr 28 2025 04:17:52 GMT+0000 (Coordinated Universal Time)
[2025-04-28 00:29:57] INFO Adding offloaded job to the inline job queue
[2025-04-28 00:29:57] INFO Scheduling job clean-tokens at 59 0 4 * * *. Next run on: Mon Apr 28 2025 04:00:59 GMT+0000 (Coordinated Universal Time)
[2025-04-28 00:29:57] INFO URL Service ready in 1382ms
[2025-04-28 00:29:57] INFO Ghost booted in 2.69s
[2025-04-28 00:29:57] INFO Adding offloaded job to the inline job queue
[2025-04-28 00:29:57] INFO Scheduling job update-check at 32 12 13 * * *. Next run on: Mon Apr 28 2025 13:12:32 GMT+0000 (Coordinated Universal Time)
[2025-04-28 00:29:57] INFO Running milestone emails job on Mon Apr 28 2025 00:29:57 GMT+0000 (Coordinated Universal Time)
[2025-04-28 00:29:57] INFO Bootstrap client was closed.
[2025-04-28 00:30:24] INFO "GET /ghost/" 200 240ms
[2025-04-28 00:30:24] INFO "GET /robots.txt?1745800224948" 200 5ms
[2025-04-28 00:30:24] INFO "GET /ghost/assets/chunk.524.9c1e444ecff073f053f5.js" 200 4ms
[2025-04-28 00:30:28] ERROR "GET /ghost/api/admin/users/me/?include=roles" 403 330ms

NAME: NoPermissionError
MESSAGE: Authorization failed

level: normal

"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."
NoPermissionError: Authorization failed
    at authorizeAdminApi (/var/www/ghost/versions/5.118.1/core/server/services/auth/authorize.js:33:25)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/5.118.1/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/www/ghost/versions/5.118.1/node_modules/express/lib/router/route.js:149:13)
    at authenticate (/var/www/ghost/versions/5.118.1/core/server/services/auth/session/middleware.js:55:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

[2025-04-28 00:30:28] INFO "GET /ghost/api/admin/site/" 200 6ms
[2025-04-28 00:30:28] ERROR "GET /ghost/api/admin/users/me/?include=roles" 403 4ms

NAME: NoPermissionError
MESSAGE: Authorization failed

level: normal

"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."
NoPermissionError: Authorization failed
    at authorizeAdminApi (/var/www/ghost/versions/5.118.1/core/server/services/auth/authorize.js:33:25)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/5.118.1/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/www/ghost/versions/5.118.1/node_modules/express/lib/router/route.js:149:13)
    at authenticate (/var/www/ghost/versions/5.118.1/core/server/services/auth/session/middleware.js:55:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

[2025-04-28 00:30:28] INFO "GET /ghost/api/admin/site/" 200 3ms
[2025-04-28 00:30:28] INFO "GET /ghost/api/admin/authentication/setup/" 200 18ms
[2025-04-28 00:30:34] WARN Missing mail.from config, falling back to a generated email address. Please update your config file and set a valid from address
[2025-04-28 00:30:34] WARN Missing mail.from config, falling back to a generated email address. Please update your config file and set a valid from address
[2025-04-28 00:31:34] INFO "POST /ghost/api/admin/session" 200 60002ms

```

What I read from it is that I don’t have email setup in some file? Would it work to just define it there without setting up a mailgun service? I guess if that would be obligatory now on newer versions of ghost, I will set it up eventually.

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [April 28, 2025, 1:09am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/8 "2025-04-28T01:09:54Z")

</div>

From version 5.118, you need to have transactional email set up so that you can deliver a verification code for admin. It doesn’t have to be mailgun, but you do need /something/ set up for transactional email, which is done in config.production.json.

This thread has links to the relevant docs:

> [@Can't login to admin dashboard on more than one device](https://forum.ghost.org/t/cant-login-to-admin-dashboard-on-more-than-one-device/57135/3):
>
> There are two new features: Device Verification (on by default) protects your sites from logins on new devices and Email 2FA, which you can additionally enable in settings - this enforces codes for every login. Ghost lacks a lot of features without SMTP mail configured, including inviting staff, password resets, email notifications and more, as well as this new security feature. There’s definitely some rough edges for us to iron out around making it easier to check and get SMTP configured - we…

---

<div class="post-metadata">

**Author:** ![Tingler](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/tingler/32/35845_2.png) [@Tingler](https://forum.ghost.org/u/Tingler)\
**Post date:** [April 28, 2025, 2:09am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/9 "2025-04-28T02:09:10Z")

</div>

Thanks, I managed to turn off double verification via email. However, if I would like to use [outlook.com](http://outlook.com) mail to receive my temporary codes would it be possible? (I don’t use anywhere the email address based on this domain website and I don’t plan to use newsletter features of ghost.)

I noticed you wrote in this other thread: "It’s possible to send those messages via an existing email provider — you don’t have to set up a whole mail server! :) "

I found something like this on their website:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/3X/1/6/160732ee92830bd1ec200b74ec3d1f3d15b80616.png)

The example from the docs is:

```json
"mail": {
  "transport": "SMTP",
  "options": {
    "service": "Mailgun",
    "auth": {
      "user": "postmaster@example.mailgun.org",
      "pass": "1234567890"
    }
  }
},

```

What would I put as service in such case? And for user and password, I would put which credentials (to [outlook.com](http://outlook.com) service or my admin into ghost credentials)?  
Or Am I getting it completely wrong, and I should just create this mail gun service?

---

<div class="post-metadata">

**Author:** ![joe-blocher](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/joe-blocher/32/27872_2.png) [@joe-blocher](https://forum.ghost.org/u/joe-blocher)\
**Post date:** [April 28, 2025, 3:57am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/10 "2025-04-28T03:57:44Z")

</div>

Maybe this helps:

> [@Unable to invite new admin users to account without mailgun setup?](https://forum.ghost.org/t/unable-to-invite-new-admin-users-to-account-without-mailgun-setup/56711/4):
>
> The configuration options in the documentation above only state: Configuring with Mailgun Amazon SES You don’t necessarily need Mailgun as a mail provider to invite any new staff … I miss a simple SMTP configuration. It would be good to specify this as well in the documentation: ... "mail": { "transport": "SMTP", "from": "website@domain.com", "options": { "host": "mail.domain.com", "port": 587, "auth": { "user": "user@domain.com", "pass": "1234" } } }, .…

---

<div class="post-metadata">

**Author:** ![secdoc](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/secdoc/32/29999_2.png) [@secdoc](https://forum.ghost.org/u/secdoc)\
**Post date:** [June 29, 2025, 2:19am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/12 "2025-06-29T02:19:21Z")

</div>

> [@Tingler](#):
>
> ```auto
> "auth": {
> 
> ```

I am unable to login from other devices…  
This is the error I get:

```auto
[2025-06-29 02:13:05] ERROR "GET /ghost/api/admin/users/me/?include=roles" 403 91ms

NAME: NoPermissionError
MESSAGE: Authorization failed

level: normal

"Unable to determine the authenticated user or integration. Check that cookies are being passed through if using session authentication."
NoPermissionError: Authorization failed
    at authorizeAdminApi (/var/www/secdoc/versions/5.127.2/core/server/services/auth/authorize.js:33:25)
    at Layer.handle [as handle_request] (/var/www/secdoc/versions/5.127.2/node_modules/express/lib/router/layer.js:95:5)
    at next (/var/www/secdoc/versions/5.127.2/node_modules/express/lib/router/route.js:149:13)
    at authenticate (/var/www/secdoc/versions/5.127.2/core/server/services/auth/session/middleware.js:48:28)

[2025-06-29 02:13:05] INFO "GET /ghost/api/admin/site/" 200 3ms
[2025-06-29 02:13:05] INFO "GET /ghost/api/admin/authentication/setup/" 200 7ms
[2025-06-29 02:13:09] ERROR "POST /ghost/api/admin/session" 500 623ms

NAME: EmailError
CODE: ESOCKET
MESSAGE: Failed to send email. Please check your site configuration and try again.

level: normal

"Please see https://ghost.org/docs/config/#mail for instructions on configuring email."
EmailError: Failed to send email. Please check your site configuration and try again.
    at Object.sendAuthCodeToUser (/var/www/secdoc/versions/5.127.2/core/server/services/auth/session/session-service.js:284:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.createSession (/var/www/secdoc/versions/5.127.2/core/server/services/auth/session/middleware.js:16:17)

```

I have the following setup in my config:

```auto
{
  "url": "http://mywebsite",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "root",
      "password": "##somepassword##",
      "database": "prod_db"
    }
  },
  "mail": {
    "transport": "SMTP",
    "from": "##some@email##",
    "options": {
      "service": "Gmail",
      "host": "smtp.gmail.com",
      "port": 587,
      "auth": {
        "user": "##some@email##",
        "pass": "##somepassword##"
      }
    }
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/secdoc/content"
  }
}

```

This is happening ever since upgrading to **Version:** [5.127.2].

Any insight would be appreciated…

---

<div class="post-metadata">

**Author:** ![Cathy\_Sarisky](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cathy_sarisky/32/25750_2.png) [@Cathy\_Sarisky](https://forum.ghost.org/u/Cathy_Sarisky)\
**Post date:** [June 29, 2025, 11:52am UTC](https://forum.ghost.org/t/cannot-login-to-ghost-admin-there-was-a-problem-on-the-server-message-appears/57094/13 "2025-06-29T11:52:16Z")

</div>

Where are you hosted? I’m wondering if we are seeing blocking of outbound ports, something that Digital Ocean started a couple months back.

Or you’ve got your password wrong? Does the from match the user?
