This Self-hosting thing is NOT for the weak!
I have been trying to wrap my head around the documentation for actvitiypub and successfully installed ghost 6 from 5.0 version. Everything works well EXCEPT for activitypub and analytics with tinybird. I decided to ditch tinybird for now to fix this issue as I really want to use activitypub. After double and triple checking the .env file, my ssl-conf and conf files I set up. I don’t know what I missed. I do not use Caddy integration as I didn’t edit my admin portal. I use NGINX as my reverse proxy, and I set it up as instructed, and I keep ending up with a “loading interrupted” error for activity pub. I can see the dashboard for a second, before that error message pops up.
My configuration files for NGINX are located in the etc/nginx/sites-avaliable/, /sites-enabled/ and /var/www/ghost/system/nginx-root folder. I copy and pasted them into these three directories just in case. I don’t know if it needs to be in /var/www/ghost/system/nginx-root only or not but that’s where I put my files.
My .ENV file configuration
Use the below flags to enable the Analytics or ActivityPub containers as well
COMPOSE_PROFILES=analytics,activitypubGhost domain
Custom public domain Ghost will run on
Ghost Admin domain
If you have Ghost Admin setup on a separate domain uncomment the line below and add the domain
You also need to uncomment the corresponding block in your Caddyfile
ADMIN_DOMAIN=
Ghost ports
Ports where Ghost will listen for HTTP traffic.
Change these if the default ports are in use, or if Ghost is behind a reverse proxy.
HTTP_PORT=80
HTTPS_PORT=443Database settings
All database settings must not be changed once the database is initialised
DATABASE_ROOT_PASSWORD=(pw)DATABASE_USER=optionalusername
DATABASE_PASSWORD= (pw)
ActivityPub
If you’d prefer to self-host ActivityPub yourself uncomment the line below
ACTIVITYPUB_TARGET=activitypub:443
Tinybird configuration
If you want to run Analytics, paste the output from
docker compose run --rm tinybird-login get-tokensbelowTINYBIRD_API_URL=https://api.us-east.aws.tinybird.co
TINYBIRD_TRACKER_TOKEN= (tracker token)
TINYBIRD_WORKSPACE_ID=(workspace ID)
Ghost configuration ( Configuration - Ghost Developer Docs )
SMTP Email ( Configuration - Ghost Developer Docs )
Transactional email is required for logins, account creation (staff invites), password resets and other features
This is not related to bulk mail / newsletter sending
mail__transport=SMTP
mail__options__host=smtp.mailgun.org
mail__options__port=2525
mail__options__secure=true
mail__options__auth__pass=(pw)
mail__from=“‘My username’ <postmaster@>mywebsite.com”Advanced customizations
Force Ghost version
You should only do this if you need to pin a specific version
The update commands won’t work
GHOST_VERSION=6-alpine
Port Ghost should listen on
You should only need to edit this if you want to host
multiple sites on the same server
GHOST_PORT=2368
Data locations
Location to store uploaded data
UPLOAD_LOCATION=./data/ghost
My .CONF file configuration
server {
listen 443 ssl http2;
server_name mywebsite.com;# SSL configuration here... location ~ /.ghost/activitypub/* { proxy_set_header Host $host; proxy_set_header Authorization $http_authorization; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_no_cache 1; proxy_cache_bypass 1; proxy_ssl_server_name on; set $upstream_app ghostactivitypub.rabbithole; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; } location ~ /.well-known/(webfinger|nodeinfo) { proxy_set_header Host $host; proxy_set_header Authorization $http_authorization; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_no_cache 1; proxy_cache_bypass 1; proxy_ssl_server_name on; set $upstream_app ghostactivitypub.rabbithole; set $upstream_port 80; set $upstream_proto http; proxy_pass $upstream_proto://$upstream_app:$upstream_port; }
My SSL.conf configuration
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;server_name mywebsite.com; root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh) ssl_certificate /etc/letsencrypt/mywebsite.com/fullchain.cer; ssl_certificate_key /etc/letsencrypt/mywebsite.com/mywebsite.com.key; include /etc/nginx/snippets/ssl-params.conf; location / { 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; proxy_pass http://127.0.0.1:2368; } location ~ /.well-known { allow all; } client_max_body_size 1g;}
server {
if ($host = mywebsite.com) {
return 301 https://$host$request_uri;
} # managed by Certbotlisten 80; listen [::]:80; server_name mywebsite.com; location / { proxy_pass http://127.0.0.1:2368; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location ~ /.well-known { allow all; }}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name mywebsite.com;
ssl_certificate /etc/letsencrypt/live/mywebsite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mywebsite.com/privkey.pem;
include /etc/nginx/snippets/ssl-params.conf;
location / {
proxy_pass http://127.0.0.1:2368;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location ~ /.well-known {
allow all;
}
}