Setting Ghost's admin url properly

  • — Guide

  • 1 min. read

  • — 2/5/2023

This weekend I ran into a particular issue with Ghost where I wanted to have the public URL point to https://shaunchander.me/blog (so links in my newsletter can point to the correct domain) but also have the admin panel accessible on a different domain entirely.

The issue was, whenever I tried accessing the domain I used for admin__url, I would get a generic error. I tried deleting and re-installing Ghost (which led to a backup and restoration of my MySQL database, ugh) and nothing came from that... until I read a very obscure post on Ghost's forums that had the solution to the exact problem I was having.

So in Ghost, you can set the admin url to a different domain using the admin__url environment variable.

My setup looked something like this:

## Ghost .env

url=https://shaunchander.me/blog
admin__url=https://example.com

However, when I tried to access https://example.com (redacted the real domain), I was greeted with this:

Cannot GET /

It wasn't the default NGINX error page so... that must mean Ghost is running correctly, but it's not able to handle my request.

Turns out, when you use a subpath in your Ghost url (in my case it was /blog), ghost appends the admin panel to it like /blog/ghost.

That means that if you want to access your Ghost admin panel, you'll need to visit https://example.com/blog/ghost. Yep, easy at that. It took a whole, roundabout process for me to figure that out.

I hope that clears things up 😉

Shaun Chander

hey (again), I'm shaun

I'm posting 3 tips on creative web development daily. Subscribe below to to get tips delivered straight into your inbox!