- HTML 64%
- TypeScript 26%
- Svelte 6%
- CSS 3%
- JavaScript <1%
- 1 more language <1%
Bluesky PDS on Synology NAS #
End Goal #
Run a reliable, self-hosted Bluesky / ATProto Personal Data Server (PDS) on a Synology NAS and behind a Dynamic IP Adress via dyDNS (ex: YOUR_SUBDOMAIN.synology.me) so you can:
- Host your own identity, posts, and media completely independent of Bluesky’s infrastructure.
- Migrate existing Bluesky accounts onto your hardware and offer hosting to friends/clients through simple invite workflows.
- Serve the PDS over a public, TLS-secured domain via Synology’s router while storing all blobs (~3 TB free) on the NAS.
This repository contains the Docker Compose stack, PDS environment file, and Caddy reverse-proxy configuration required to reproduce the working deployment.
Development Workflow #
Use a normal local clone for all development work:
cd ~/work/bluesky-pds/pds-on-synology
Do not use a mapped Synology volume such as /Volumes/docker/bluesky-pds for
Git work. Synology shared-folder metadata can create @eaDir sidecars and has
previously corrupted Git refs. The NAS checkout at /volume1/docker/bluesky-pds
is production state and should normally only be changed by the Tangled deploy
pipeline.
Repository Layout #
.
├── docker-compose.yml # caddy + pds + pdsdash + watchtower stack
├── pds.env # secrets and runtime configuration
├── caddy/
│ └── etc/caddy/Caddyfile # on-demand TLS reverse proxy
├── pds-dash/ # Frontend dashboard (Svelte + Vite)
│ ├── src/ # Source code
│ ├── themes/ # UI themes (default, reductionist, etc.)
│ ├── config.ts # Dashboard configuration
│ └── dist/ # Built assets (generated, served by nginx)
└── pds-data/ # SQLite databases, blobstore, tmp, etc.
Prerequisites #
- Synology NAS with DSM 7.x, Docker package, and SSH access.
- Public DNS entry pointing
YOUR_SUBDOMAIN.synology.meto your WAN IP. - Internet Router, with port forwarded:
- External TCP 80 → NAS
8080 - External TCP 443 → NAS
8443
- External TCP 80 → NAS
- Local directories created on the NAS:
/volume1/docker/bluesky-pds(this repo)/volume1/docker/bluesky-pds/pds-data(will hold SQLite + blobs)/volume1/docker/bluesky-pds/caddy/{data,etc/caddy}
- Deno installed only for local dashboard development
- Install from deno.com or via package manager
- Production deploys build the dashboard through the Compose Deno image
Configuration #
-
Environment (
pds.env)- Populate
PDS_HOSTNAME,PDS_ADMIN_EMAIL,PDS_ADMIN_PASSWORD,PDS_JWT_SECRET,PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX. - Ensure storage paths match the Synology mount (
/pds-data,/pds-data/blobs, etc.). - Update SMTP settings before enabling email verification.
- Rotate secrets if this repository is ever shared.
- Populate
-
Caddy (
caddy/etc/caddy/Caddyfile)- Uses on-demand Let’s Encrypt certificates with the PDS
/tls-checkendpoint. - Proxies
YOUR_SUBDOMAIN.synology.meand*.YOUR_SUBDOMAIN.synology.metohttp://pds:3000.
- Uses on-demand Let’s Encrypt certificates with the PDS
-
Compose (
docker-compose.yml)caddypublishes ports8080:80and8443:443.- Bind mounts are relative to the checkout, so the same file works on a laptop and on the NAS production checkout.
pdsbinds the checkout →/pdsplus localpds-data/→/pds-data.pdsdashserves the built frontend frompds-dash/distvia nginx.watchtowerkeeps images refreshed nightly.
-
Dashboard (
pds-dash/)- Copy
pds-dash/config.ts.exampletopds-dash/config.ts. - Configure
PDS_URL,THEME,FRONTEND_URL, and other settings. - Build the dashboard:
cd pds-dash && deno task build. - For development with hot reload:
cd pds-dash && deno task watch.
- Copy
Local Docker Compose #
The Compose file uses relative bind mounts, so it can run from a local clone without mounting the Synology volume:
cd ~/work/bluesky-pds/pds-on-synology
cp pds.env.example pds.env # if you do not already have a local env file
mkdir -p pds-data pds-api/data caddy/data pds-dash/dist
docker compose --profile build run --rm pdsdash-build
docker compose up -d
This creates local runtime data under pds-data/, pds-api/data/, and
caddy/data/. Those paths are ignored by Git and are separate from production
data on the NAS. Production deploys still run Compose with
--project-directory /volume1/docker/bluesky-pds, so the same relative paths
resolve to the NAS checkout during deployment.
Frontend Development #
For dashboard work, run the backend stack in Docker and run Vite on the laptop:
cd ~/work/bluesky-pds/pds-on-synology
./run
./run starts pds, pdsapi, and pds-list-updater with
docker-compose.local.yml, waits for pdsapi, then starts Vite from
pds-dash/. Open http://127.0.0.1:5173. Vite proxies /api/* and
/oauth-client-metadata.json to http://127.0.0.1:8000. Do not use
npm run dev; this project uses Deno.
By default local auth expects 127.0.0.1:5173. ./run now enforces
--strictPort, injects matching local FRONTEND_URL and REDIRECT_URI, and
uses the AT Protocol localhost development CLIENT_ID form
(http://localhost?redirect_uri=...) with a URL-encoded 127.0.0.1 callback.
If you need another port, run VITE_PORT=5174 ./run.
Deploy & Validate #
Production deploys are automated through Tangled Spindle. Once the one-time
bootstrap in docs/deploy.md is complete, deploying production is:
git push origin main
The Tangled workflow in .tangled/workflows/deploy.yml SSHes to the NAS at
pixeline.synology.me:1973 as deploy-pds, fast-forwards the NAS checkout, and
runs /volume1/docker/bluesky-pds/scripts/deploy-production.sh with the pushed
commit SHA. The script builds pds-dash/dist, validates Compose and the
Caddyfile through Compose-only helper services, updates the stack, restarts
pdsapi, pdsdash, and caddy, then waits for health checks and public smoke
checks.
Deploys fail before restarting services when the NAS checkout has modified or
staged tracked files, the branch cannot fast-forward, the dashboard build fails,
or docker compose config -q fails.
First-time Setup #
Follow docs/deploy.md to:
- create the dedicated
deploy-pdsNAS user - add a deploy SSH key
- configure limited passwordless sudo for Docker Compose and inspect commands
- add Tangled pipeline secrets
- run the first manual Spindle deployment
Manual Recovery #
If Tangled or deploy SSH automation is unavailable, SSH to the NAS and deploy manually:
ssh deploy-pds@pixeline.synology.me -p 1973
cd /volume1/docker/bluesky-pds
git status --short
git fetch --prune origin main
git merge --ff-only origin/main
/bin/bash /volume1/docker/bluesky-pds/scripts/deploy-production.sh "$(git rev-parse HEAD)"
sudo docker compose ps
curl -fsS https://atproto.brussels/api/public/registration-status
curl -fsS https://atproto.brussels/api/pds-list
Useful Logs & Maintenance #
sudo docker compose logs -f pds
sudo docker compose logs -f caddy
sudo docker compose logs -f pdsdash
sudo docker compose exec pds sh # drop into the container if needed
sudo docker compose down && sudo docker compose up -d
Account & Invite Management (goat CLI) #
The official goat CLI is preinstalled inside the pds container. Run all commands from /volume1/docker/bluesky-pds on the NAS.
Create Invite Codes #
sudo docker compose exec pds goat pds admin create-invites \
--count 1 \
--uses 1
Output includes code values such as pixeline-synology-me-xxxxxx-xxxx. Increase --count or --uses to issue more invites.
Create Accounts #
sudo docker compose exec pds goat account create \
--pds-host https://YOUR_SUBDOMAIN.synology.me \
--handle <handle.YOUR_SUBDOMAIN.synology.me> \
--email <you@example.com> \
--password '<StrongPassword>' \
--invite-code <code-from-create-invites>
goat returns the new DID on success. Handles should match your desired hosted subdomain (e.g. alex.YOUR_SUBDOMAIN.synology.me).
List Accounts / Invites #
docker compose exec pds goat pds account ls
List all accounts using XRPC API:
curl https://YOUR_SUBDOMAIN.synology.me/xrpc/com.atproto.sync.listRepos | jq '.repos[] | {did: .did, active: .active}'
Or to get just the DIDs:
curl https://YOUR_SUBDOMAIN.synology.me/xrpc/com.atproto.sync.listRepos | jq -r '.repos[].did'
List invite codes:
sudo docker compose exec pds goat pds admin list-invites
Generate Additional Invites Later #
sudo docker compose exec pds goat pds admin create-invites \
--count 5 \
--uses 3
Future Steps / Notes #
- Account migration: Follow Bluesky’s migration guide to move an existing handle once SMTP + DNS are verified.
- Backups: Snapshot
/volume1/docker/bluesky-pds/pds-dataregularly (SQLite + blobs). - Monitoring:
watchtowerauto-updates images nightly; rerundocker compose up -dafter config changes. - Security: After finishing setup, rotate
PDS_ADMIN_PASSWORD,PDS_JWT_SECRET, and the PLC rotation key, then redeploy. - Scaling invites/hosting: Build a Synology UI layer that wraps the
goatcommands above to let friends request invites and provision handles on*.YOUR_SUBDOMAIN.synology.me.
With networking, TLS, and account tooling in place, the NAS is ready to host additional users and serve as the foundation for your Bluesky hosting service.