Upgrade from 5 to 6 using Portainer

I am currently running Ghost 5 from a local portainer install. I’d like to upgrade my instance from 5 to 6.

Here is my current compose file (with the sensitive bits X’d out obviously) :

version: '3.1'

services:

  ghost:
    image: ghost:5-alpine
    restart: always
    ports:
      - 11111:22222
    environment:
      database__client: mysql
      database__connection__host: db
      database__connection__user: root
      database__connection__password: XXXXXX
      database__connection__database: ghost

      mail__transport: "SMTP" 
      mail__options__service: Mailgun
      mail__options__auth__user: XXX@XXXXX.com
      mail__options__auth__pass: XXXXXXX

      url: https://example.com
    volumes:
      - ghost:/var/lib/ghost/content

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: XXXXXXX
    volumes:
      - db:/var/lib/mysql

volumes:
  ghost:
  db:

Am I safe to just change the image name? I am unclear on how to get the ActivityPub features setup and Tinybird. I did read through this Notion doc, but it really doesn’t speak to me as some that is using Portainer to manage their running containers.

Oh; it’s worth noting that I use Nginx as a frontend and manage my own certs, as that frontend also serves as proxy for many other sites and services and I don’t really want Ghost to manage that part of it.

Any guidance would be much appreciated!

Hey Robert, sorry I don’t have a complete answer to you, but I’m on the same boat.

I self-host using Coolify, which is basically what you’re describing.

The last update I did, from 4 something to the latest 5, I indeed simply changed the image.

I repeated the same today, pointing to 6 alpine, but some features are not working, like the activitypub area.

Indeed the posts do suggest that we need new environment variables in the composer file, but it’s not exactly clear which.

For the record, trying to visit the activitypub results in 404 for all the /activitypub/… calls. So it’s pretty clear we’re missing part of the endpoints.

@Robert_Johnson you can just change the name. I’m using ghost:6-alpine. You can continue using your nginx frontend (npm?) but you’ll need to add 3 custom location blocks to forward to the upstream activitypub service at ap.ghost.org.

@andrecalil if you’re using coolify, you’ll need to add extra routing definitions to your traefik or caddy config. Here’s what I used for traefik: Question: How to define custom location block (e.g. /.ghost/*) via Traefik instead of Caddy? - #3 by eddywashere

Ignore the following, I missed the fact that there is the traffic-analytics service actually running.

I have not added the analytics to my setup, but maybe sharing my plan will help. Portainer and Coolify don’t really handle one off tasks well but you could add a separate stack for just the analytics tasks that need to be run. From there you can enable or disable each service and command to run for a one-off deployment or run of the task. I believe each service block will need a restart policy set to no or restart: no. From there, you can comment out the blocks not needed or set the depends on in a way to run properly.

1 Like

Yep, this did the trick. Added the label for the ghost service and the extra config in Traefik. Thanks!

1 Like

Wanted to come back around and give an update. I ended up just changing ghost:5-alpine to ghost:6-alpine.

This worked fine for the Ghost application, obviously it didn’t include the new analytics; (I don’t mind as I use plausible when needed.

Once I upgraded, the Network tab gave an error. Once I added the following to my nginx conf for the site, that cleared up and worked as expected.

location ~ /.ghost/activitypub/* {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Host $http_host;
  add_header X-Content-Type-Options "nosniff";
  proxy_ssl_server_name on;
  proxy_pass https://ap.ghost.org;
}

location ~ /.well-known/(webfinger|nodeinfo) {
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto $scheme;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header Host $http_host;
  add_header X-Content-Type-Options "nosniff";
  proxy_ssl_server_name on;
  proxy_pass https://ap.ghost.org;
}

I did try various settings to get the new activitypub and activitypub-migrate containers to work, but I didn’t. I might revisit it if I exceed the limits which I expect I won’t.

2 Likes