# Ghost Backup Cli Command Line 403 Forbidden

**URL:** <https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620>\
**Category:** Self-hosting\
**Created:** [May 24, 2024, 7:22am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620 "2024-05-24T07:22:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![xtreme07](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xtreme07](https://forum.ghost.org/u/xtreme07)\
**Post date:** [May 24, 2024, 7:22am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/1 "2024-05-24T07:22:57Z")

</div>

I want to make a backup before updating it using the cli command `ghost backup` in the ghost directory `/var/www/ghostblog` . However i seem to hit a wall. I get an error that i dont understand it. Looking into the log file i thought that maybe the `/ghost/api/admin/authentication/setup/` is blocked. So i made sure i unlock access to it from both nginx server and cloudflare. More specifically i made sure `/ghost` , `/members` , `/webmentions` , `/email` ,` /r/` are all reachable (because i usually lock access to them - as an extra security measure)

Below you can see the error messages i got after running the `ghost backup` command line.  
Your input would be much appreciated.

> ✖ Backing up site  
> An error occurred.  
> Message: ‘Response code 403 (Forbidden)’
> 
> Debug Information:  
> OS: Ubuntu, v22.04.4 LTS  
> Node Version: v18.20.2  
> Ghost Version: 5.82.2  
> Ghost-CLI Version: 1.26.0  
> Environment: production  
> Command: ‘ghost backup’

> An error occurred.  
> Message: ‘Response code 403 (Forbidden)’
> 
> Stack: HTTPError: Response code 403 (Forbidden)  
> at EventEmitter. (/usr/lib/node\_modules/ghost-cli/node\_modules/got/source/as-promise.js:74:19)  
> at process.processTicksAndRejections (node:internal/process/task\_queues:95:5)  
> Path: /ghost/api/admin/authentication/setup/

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 24, 2024, 9:06am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/2 "2024-05-24T09:06:47Z")

</div>

It’s unclear exactly what you’re doing here, but to run `ghost backup`, access to the server via command line, i.e., SSH, is needed. You should not attempt this via HTTP or the proxy server, and certainly should not expose Ghost folders.

---

<div class="post-metadata">

**Author:** ![xtreme07](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xtreme07](https://forum.ghost.org/u/xtreme07)\
**Post date:** [May 24, 2024, 9:24am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/3 "2024-05-24T09:24:34Z")

</div>

yep, the backup command was from ssh. ran the `backup` command with the user that has sudo privileges. the command i entered was `ghost backup` .  
the 403 forbidden was outputed after being prompted by the ghost cli to enter the sudo password. my password was fine.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 24, 2024, 9:35am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/4 "2024-05-24T09:35:30Z")

</div>

I dont understand what you mean here:

> [@xtreme07](#):
>
> So i made sure i unlock access to it from both nginx server and cloudflare. More specifically i made sure `/ghost` , `/members` , `/webmentions` , `/email` ,` /r/` are all reachable (because i usually lock access to them - as an extra security measure)

Anyway, please run `ghost doctor` and post the output.

---

<div class="post-metadata">

**Author:** ![xtreme07](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xtreme07](https://forum.ghost.org/u/xtreme07)\
**Post date:** [May 24, 2024, 9:40am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/5 "2024-05-24T09:40:10Z")

</div>

`ghost doctor` says everything is ok. the only thing that might not be proper is that it’s saying `"ℹ Validating config [skipped]`  
"  
regarding the urls mentioned, those are the urls i saw in the robots txt file and decided to just deny acces to them using cloudflare and nginx, so robots cant browse them.

this is the ghost doctor output

> ✔ Checking system Node.js version - found v18.20.2  
> ✔ Checking logged in user  
> ✔ Ensuring user is not logged in as ghost user  
> ✔ Checking if logged in user is directory owner  
> ✔ Checking current folder permissions  
> ✔ Checking system compatibility  
> ✔ Checking for a MySQL installation
> 
> - sudo systemctl is-active ghost\_site.com  
> ? Sudo Password [hidden]  
> Instance is currently running  
> ℹ Validating config [skipped]  
> ✔ Checking folder permissions  
> ✔ Checking file permissions  
> ✔ Checking content folder ownership  
> ✔ Checking memory availability  
> ✔ Checking binary dependencies  
> ✔ Checking free space  
> ✔ Checking systemd unit file  
> ✔ Checking systemd node version - found v18.20.2

---

<div class="post-metadata">

**Author:** ![xtreme07](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xtreme07](https://forum.ghost.org/u/xtreme07)\
**Post date:** [May 24, 2024, 10:26am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/6 "2024-05-24T10:26:54Z")

</div>

i just saw that in the cloudflare logs there’s a request to `/ghost/api/admin/authentication/setup/` when i run the backup command. this request is blocked by cloudflare…which seems odd to me.

that’s the url that is in the debug log i showed you in my main post  
the user agent trying to o access that url is `got/9.6.0 github.com/sindresorhus/got`

do you know of it ? i dont understand it  
so from what i gather, there’s an http request to that url /`ghost/api/..` , by the script `got 9.6.0` when i try to do the backup. is this supposed to happen ?

as a side note, my inbound rules on the server are set to deny for all ports. my computer ip and cloudflare’s proxy ip’s are the only allowed ones to access the server .

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [May 24, 2024, 1:36pm UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/7 "2024-05-24T13:36:44Z")

</div>

The config is skipped because Ghost is running. You should not be concerned with Nginx etc. since this isn’t relevant. Ghost uses Node, and this server is refusing to to run the backup because the user executing the command isn’t authorized to do so. Most likely you have a permissions issue.

Have you tried `sudo ghost backup', and do the enter the correct credentials when prompted by `ghost-cli`?

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [May 24, 2024, 2:08pm UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/8 "2024-05-24T14:08:35Z")

</div>

The content and member export tasks run within the backup command work by using the Admin API so the machine you’re running the command on will need full access to the API via the configured site URL. It sounds like you have something that is blocking that and returning the 403

---

<div class="post-metadata">

**Author:** ![xtreme07](https://avatars.discourse-cdn.com/v4/letter/x/53a042/32.png) [@xtreme07](https://forum.ghost.org/u/xtreme07)\
**Post date:** [June 2, 2024, 6:11pm UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/10 "2024-06-02T18:11:35Z")

</div>

Thank You for the help. @Kevin was on point with the concern i had. @mjw help is much appreciated as well. Problem solved

For others stumbling into similar situation here’s my note. i allowed the access to such requests , by using cloudflare’s waf \> tools \> then added my server’s ip address to allow list

---

<div class="post-metadata">

**Author:** ![Denys\_Pulinets](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/denys_pulinets/32/36002_2.png) [@Denys\_Pulinets](https://forum.ghost.org/u/Denys_Pulinets)\
**Post date:** [June 23, 2025, 9:26pm UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/11 "2025-06-23T21:26:18Z")

</div>

Don’t understand how you exactly to solve problem. Waf in cloudflare for enterprises only. Do you mean security rules or what?

---

<div class="post-metadata">

**Author:** ![ipeltur](https://avatars.discourse-cdn.com/v4/letter/i/9fc29f/32.png) [@ipeltur](https://forum.ghost.org/u/ipeltur)\
**Post date:** [February 11, 2026, 2:04am UTC](https://forum.ghost.org/t/ghost-backup-cli-command-line-403-forbidden/47620/12 "2026-02-11T02:04:14Z")

</div>

I have the same issue, but could not get it working with a rule. I created this one

Security \> Security rules \> Added one with “VPSs IP \> Action “Skip” \> WAF components to skip – checked all of them.

But I still get a 403 ☹ Can you please help me how to set this up correctly?
