ActivityPub
A multi-tenant ActivityPub server for Ghost, built with Fedify. This service makes it possible for independent websites to publish their content directly to the Fediverse, enabling networked publishing to the open social web.
This repository is being actively developed and is currently in beta - expect many breaking changes. It is not suitable for production use.
How it works
All requests to /.ghost/activitypub/*, /.well-known/webfinger and /.well-known/nodeinfo are proxied to this ActivityPub service using nginx. All other requests are forwarded to Ghost.
Running locally for development
This has only been tested on macOS using Docker for Mac and OrbStack.
Setup
- Install Ghost using
Install from sourceinstructions - Proxy with Tailscale (or ngrok)
- Use
tailscale funnel 80orngrok http 80to expose your local port 80
- Use
- Configure Ghost
- In the Ghost monorepo, create a
config.local.jsonfile underghost/core/config.local.json, with the following configuration:
{ "url": <Tailscale or ngrok URL from step 2>, "labs": { "ActivityPub": true } } - In the Ghost monorepo, create a
- Start the ActivityPub Service
- Run
yarn dev && yarn logsin the root directory of this project
- Run
- Start Ghost
- Run
yarn devin the Ghost monorepo
- Run
Code formatting + linting
We use Biome for code formatting and linting.
If you use VS Code, you can install the Biome extension to get inline feedback.
To enable auto-formatting on save, you'll need to set the default formatter to Biome and enable Format on Save in your VS Code settings.
Running Tests
- Run
yarn testto execute tests within a Docker Compose stack.
Populating the DB
The below command will populate the DB with ~5000 followers for the activitypub host
- Run
docker compose run scripts populate-activitypub-db
Migrations
docker compose run migrate or docker compose run migrate-testing will run the up migrations against your dev or testing db respectively.
If you would like to run other commands you can run docker compose exec -it migrate /bin/bash or docker compose exec -it migrate-testing /bin/bash - This will drop you into a shell with the migrate binary available as well as a MYSQL_DB environment variable that is correctly formated for use as the -database argument to the migrate binary
Copyright & license
Copyright (c) 2013-2025 Ghost Foundation - Released under the MIT license. Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our trademark policy for info on acceptable usage.