ungovernable.tech

Field guide[ GUIDE ][ IDENTITY, SOCIAL AND TRUST ][ SOVEREIGN NAMING ]

Running a Pubky Homeserver

Also Pubky homeserver guide, Running a Pubky homeserver, Pubky Ring grants.

A Pubky homeserver is a per-key file store, not a social network. It serves `/pub/` and `/priv/` for the keys that signed up on it, and it publishes a signed PKARR record so clients can find that store from the public key alone.

updated 2026-11-10 17 min read [ ADVANCED ]
Contents

Companion notes: Pubky for the protocol stack, PKARR for the DHT naming primitive, and Nostr for the sibling key-rooted system. Version anchors below were read from the repos and docs on 2026-11-10.

Summary

Pubky splits identity from hosting. The identity is an Ed25519 key held by the user (typically in Pubky Ring). The homeserver is whoever that user picks to store files. Discovery is a signed PKARR packet on the BitTorrent Mainline DHT, plus HTTP relays for browsers that cannot speak the DHT. The reference server is pubky/pubky-homeserver (MIT). pubky/pubky-core now resolves to that same repository.

Checked 2026-11-10:

Component What shipped Date
Homeserver tag v0.18.0 2026-11-09
pkarr tag v9.0.0 2026-11-09
Pubky Ring tag v2.0; main still moving (grant-refresh commit b1f9157, 2026-11-09) tag 2026-10-05
pubky-app tag v1.13.0; repo pushed 2026-11-10 tag 2026-11-04
pubky-nexus last GitHub release tag v0.3.1; main pushed 2026-11-09 tag 2025-02-20

The install guide's sample pin was still PUBKY_VERSION=0.17.0 when fetched on 2026-11-10, the day after v0.18.0. Use the releases page, not a copied pin. pubky.org's homeserver page still linked docs at blob/v0.14.0 on the same date. Treat the repo tag as the operator source, not the marketing site.

A homeserver buys retention and signup policy. It does not buy anonymity. The operator sees client IPs, public files, and — because /priv/ is access control, not encryption — every private file too. Pubky's own security model says so.

What the process actually stores

pubky-homeserver init (v0.10+) writes ~/.pubky/ with a sample config.toml and a server keypair. That keypair (~/.pubky/secret) is the server's identity, not a user's. The post-setup guide says if it is lost, the server cannot be recovered. User files default to ~/.pubky/data/files (storage.type = "file_system"). In-progress uploads stage in data/files-tmp and do not need a backup. PostgreSQL is a separate required database; the sample URL is postgres://localhost:5432/pubky_homeserver, and the database must already exist.

Two namespaces, from the private-storage guide:

Root Who can read What it is not
/pub/ Anyone Not a private folder
/priv/ A session for that same user whose capability covers the path Not encryption

The admin API is a different authorization domain. An administrator can read and write all tenant data, including /priv/. Applications that need confidentiality encrypt before upload. The homeserver then stores ciphertext. Sizes and access patterns stay visible.

A signed PKARR record proves who published the locator. It does not prove that the bytes at that locator are what the user wrote. The security model states that explicitly: an operator can alter, withhold, or delete data, and an independent copy does not by itself detect tampering.

Ports and the two protocols

The homeserver speaks two protocols over the same data. The difference is how the client finds the server and who vouches for the TLS key.

Port Role Expose?
6287 Pubky TLS. Clients resolve the homeserver public key on the DHT and connect with raw public-key TLS (RFC 7250, Ed25519 0x0807). No certificate authority. Yes, if you want native clients. Bind 0.0.0.0:6287. The shipped default is 127.0.0.1:6287.
443 HTTPS for browsers and the browser SDK. Needs a CA certificate. Yes, via Caddy or equivalent.
80 ACME HTTP-01 for that certificate. Yes, while issuance and renewal run.
6286 Plain HTTP for the reverse proxy (icann_listen_socket). No. Keep on 127.0.0.1.
6288 Admin API. Default password in config.default.toml is admin. No.
6289 Prometheus /metrics. Disabled in the shipped default; enabled in the sample. No.

Pubky TLS is the path that does not depend on a CA or a domain. HTTPS is the path browsers can use today. A deployment that only has HTTPS still works for browser apps. It does not give native clients a CA-less connection.

pkarr's TLS note: a reverse proxy in front of Pubky TLS must not terminate TLS. It forwards the handshake. The homeserver's own key is what the client checks.

Signup tokens

Shipped default, from config.default.toml:

signup_mode = "token_required"

open lets anyone create an account. token_required is the default even when the field is omitted (SignupMode defaults to TokenRequired). A public homeserver left on the default will refuse signup until an operator mints a token. That is the invite gate, not a bug.

Mint from the admin API on localhost, or from homeservercli (password via env or config, not a shell flag — the CLI readme warns that --admin-password lands in history and the process list):

homeservercli signup-tokens generate --storage-quota-mb 500 --rate-read 10mb/s --rate-write 1mb/s

GET /generate_signup_token creates a token whose limits stay Default and are resolved later from system config. POST accepts explicit quotas: a number, "unlimited", or omitted/null for the system default. The CLI flags map onto that body (--storage-quota-mb, --rate-read, --rate-write, --allowed-write-paths).

The shipped rate-limit table caps GET /signup_tokens/* at 10 requests per minute per IP. The sample comments say that exists to slow invite-code guessing. It is not a substitute for a long token.

Ring accepts an invite as st on a signup link, or as pubkyring://invite/XXXX-XXXX-XXXX. Synonym's own codes use that grouped form. A custom homeserver may use an opaque token; Ring's setup screen will accept an unrecognized plain token for a selected custom server and will not rewrite its case. Setup's invite scanner rejects links that would also authorize an app. Signup and app authorization are separate steps unless the user scans a combined signup / signup_grant link on purpose.

A token is an account-creation credential. It is not a capability grant. After signup, apps still need a Ring approval.

Static IP and the PKARR record

Native clients do not look up a domain. They resolve the homeserver public key and read the signed packet. The fields that packet is built from live under [pkdns]:

  • public_ip — address advertised for Pubky TLS. Shipped default is 127.0.0.1. Leave that and the record points at the server itself.
  • icann_domain — hostname or, for the IP-only guide, the same public IP. Shipped default is localhost.
  • public_pubky_tls_port — defaults to the listen port (6287).
  • user_keys_republisher_interval — shipped default 14400 seconds (4 hours). 0 disables republish.
  • dht_relay_nodes — shipped default https://pkarr.pubky.app and https://pkarr.pubky.org.

The IP-only guide states the failure mode in one sentence: if the public IP changes, the PKARR record and the Caddy config silently point at a dead address. A dynamic home connection is the wrong shape for Pubky TLS. Use a reserved address, or accept HTTPS-only.

Three shapes, from docs/DEPLOY.md (fetched 2026-11-10):

Shape Static IP Pubky TLS Certificate
Domain + Caddy Yes. Ports 80, 443, 6287. Yes ~90 days, auto-renewed
IP address only Yes. Same ports. Caddy v2.10.1+ and homeserver v0.17.0+ (PROXY protocol). Yes ~6-day shortlived profile. Renewal needs port 80. A few failed days and HTTPS dies.
Cloudflare Tunnel No. No inbound ports. No Cloudflare-managed. Browser HTTPS only.

From v0.17.0, IP rate limits use a per-listener client identity (direct, proxy_protocol, or http_header). direct behind a proxy means every visitor shares the proxy's IP budget. The Caddy guides send a PROXY v2 preface. Cloudflare Tunnel does not. To split visitors there, set icann_client_identity to http_header with CF-Connecting-IP and trust only the connector's address. A proxy you trust can claim any client IP. v0.18.0 (PR #801, 2026-11-09) is the release that added the HTTP-header mode the deploy guide now documents.

After restart, the admin API on 127.0.0.1:6288 returns the server public_key (GET /info, header X-Admin-Password). Look that key up on pkdns.net or with pkarr's resolve example. Expect an A record for public_ip and HTTPS/SVCB records for the Pubky TLS port and the ICANN name. A cold Pubky TLS check is pkarr's http-get example against https://<homeserver-public-key>. Success prints Pubky Homeserver. Skip that check on a Cloudflare Tunnel deploy; port 6287 is not on the internet.

Change admin_password before the box faces anyone. The shipped default is the string admin.

Pubky Ring and the grant model

Ring is the key manager. It holds identity keys. Apps do not receive them. Installs: iOS, Play, and APK releases. The security guide says not every release ships a detached signature or a maintainer key in the repo. A checksum without a trusted fingerprint does not identify the publisher.

What a grant is

Since homeserver v0.10 the recommended session is a grant, not a cookie. The v0.10 migration note, still the spec the current docs point at:

Grant Cookie (deprecated, scheduled for removal)
One app, one client key Same homeserver cookie shared across websites in the browser
Authorization: Bearer HTTP session cookie
Bearer lasts one hour; SDK refreshes with a proof-of-possession Cookie sessions can last up to a year
Replay needs the client private key No replay prevention
Listed and revoked one by one No listing or revocation
Built for later homeserver mirroring One homeserver

The flow, from pubky.org/authentication and docs/AUTH.md:

  1. The app generates a 32-byte client secret and subscribes to base64url(hash(secret)) on an HTTP relay.
  2. It shows a pubkyauth:// link or QR: relay URL, requested capabilities, and the secret. Current SDK links are signin_grant / signup_grant and also carry cid (client id) and cpk (client public key).
  3. Ring shows a consent screen. Approval signs an auth token with the identity key and encrypts it to the client secret before posting it to the relay.
  4. The app decrypts, resolves the user's homeserver, and exchanges the grant plus a short-lived PoP proof for an opaque bearer (POST /auth/grant/session).
  5. Later requests are checked against the capabilities stored with that session.

Capabilities are scope:actions. Actions are r and w. A trailing slash is a directory. /priv/my-app/:rw is one app's private tree. /:rw is every valid path. pubky.org tells users to treat root grants as account-level and to reserve them for tools they actually trust.

spk on a signin_grant link (homeserver PR #787, shipped in v0.18.0) pins the expected identity. Ring must approve with that key or not at all. The tradeoff, written in docs/AUTH.md: a deep link can probe whether Ring holds a named key, because a missing key errors locally and a held key reaches the approval screen.

What revocation does and does not do

SDK sign-out of an active grant-backed session revokes that grant. Every session issued from it dies, including other tabs. A different grant to the same app is untouched. Deleting the browser record (remove, clear) forgets the credential locally and does not revoke the homeserver grant. If the bearer is already dead, sign-out can report success without revoking. Homeservers that advertise grant-proof-logout accept grant-plus-PoP on DELETE /auth/grant/session, so logout still works after the one-hour bearer expires. Older servers need a still-valid bearer.

IndexedDB is the browser trust boundary. Delegated signing keys can be non-extractable. The rest of the restore material, including encryption keys, is stored in the clear. Do not export those records.

Ring's device-authentication setting (off by default, including on upgrade) is a local presence check before approval and before showing a recovery phrase or migration QR. The security guide is explicit about the limits: it does not move keys into a stronger store, it does not stop a compromised app process from using keys already loaded, and it does not revoke grants already issued. A native authorization already submitted to the SDK cannot be recalled. Cancel hides the UI. It does not unwind a grant the server has accepted.

Key backup and data backup are different products. Ring's recovery phrase restores the identity. It does not restore files a homeserver deleted. Pubky Backup is the data-side tool, and automated restore is still described as maturing.

Version-zero auth, still documented in docs/AUTH.md, has no delegation. The identity key signs the token. There is no issuer certificate and no revocation lookup at verify time, because both would make verification async. Session lifetime after the token exchange is the homeserver's problem, not the token's. The token itself is valid for a three-minute skew window and is single-use on (timestamp, pubky).

The HTTP relay is an untrusted forwarder. AUTH.md's reason for encrypting the token to the client secret is that a relay which sees a plaintext bearer token can use it first. Grant-mode replay additionally needs the app's PoP key. A relay that only sees ciphertext still sees timing, the channel id, and the app's network address.

Pubky App

pubky.app is not Pubky Core. pubky.org's app page says so. It is a Next.js progressive web app (the page names Next.js 16, React 19, Dexie, TanStack Query, and @synonymdev/pubky) that uses the SDK for auth and storage and Nexus for feeds. Writes go to the homeserver under /pub/pubky.app/ following pubky-app-specs. The app page's data flow is: write to the homeserver, Nexus polls /events/, clients read the index, Dexie covers offline.

That split is the trust split. A post you can see in the app is a Nexus row until you fetch the homeserver URL and check it yourself. The app's local-first write path makes the UI feel instant. It does not make the index the source of truth.

Tag v1.13.0 was published 2026-11-04. The repo had no README.md on main when fetched 2026-11-10 (HTTP 404). Use the release tag and the pubky.org app page, not an assumed readme.

Nexus is an indexer, and the indexer has an operator

pubky.org/indexing-and-aggregation is the short version: a feed has to join records that live on many homeservers. Aggregation, indexing, and an API are one service's job. Nexus is that service for pubky.app social data. The index is a derived view. It does not replace homeserver records. Another operator can build a different view over the same public files.

The Nexus README is blunter about the default read path. Full-content indexing means the API serves the bytes. Clients do not have to find the homeserver unless they want to attest the content. A lightweight mode that only returns pubky:// URIs is described as a vision, not the current API. Staging is https://nexus.staging.pubky.app/swagger-ui/. Production is https://nexus.pubky.app/swagger-ui/. The README still marks /v0 unstable.

What the watcher actually does, from docs/decentralization.md and nexus-watcher/default.watcher-config.toml on main (2026-11-10):

  • One primary homeserver is bulk-ingested from /events. The checked-in default is the Synonym homeserver 8um71us3fyw6h8wbcxb5ar3rwusy1a6u49956ikzojg3gcwd1dty. The same document says the primary homeserver is trusted, which implies a different event-validation model than third-party servers. The file does not spell that difference out. Do not invent it. The operational fact is: that server's events are pulled in bulk, on a 5-second trigger, 50 events per run in the default file.
  • Other homeservers are indexed per user, after a resolver writes (:User)-[:HOSTED_BY]->(:Homeserver) from PKDNS. Default cap is 50 external homeservers, 50 events per user per run. external_hs_pk_blacklist drops new events from listed server keys. Existing rows stay. Dependency events that were dropped because a user lived on a blacklisted server are not replayed when the key is later removed.
  • If PKDNS cannot reproduce a stored mapping, the edge is marked stale and the watcher stops indexing that user. A DHT or relay outage therefore pauses indexing, not just delays it. Default hs_resolver_ttl is 3,600,000 ms. Nexus can keep reading an old homeserver for about an hour after a move, then stop if resolution fails.
  • The resolver stores the signed PKARR packet (record as hex, record_ts in microseconds) so the mapping can be checked with StoredRecord::verify. A mapping can be stale relative to the packet it still holds.

Trust rank is a second operator choice, not a protocol output. TrustRankConfig runs personalized PageRank on the follow graph through Neo4j GDS. Seeds are equal weight. Default alpha is 0.35. The seed list is empty until an operator sets it, and an empty seed means trust rank is not computed. hide_unranked_authors defaults to false. When an operator turns it on, posts by authors outside that ranking disappear from the shared streams. The ranking is whoever the operator seeded.

The same default watcher file names a moderation key (uo7jgkykft4885n8cruizwy6khw71mnu5pq3ay9i8pw1ymcn85ko) and a tag list (hatespeech, harassement — spelled that way in the file — terrorism, violence, illegal_activities, il_adult_nu_sex_act). The comment says it is a test key to change. Anyone who runs the file unchanged has delegated de-indexing to that key. This note does not claim the production nexus.pubky.app process uses that file byte for byte. It claims the repo's default does.

Sample Neo4j password in that file is 12345678. Treat the file as a development config.

Last tagged Nexus release remains v0.3.1 (2025-02-20) while main moved on 2026-11-09. Do not cite the tag as the code behind the production API.

Trade-offs

What self-hosting actually changes

  • Signup policy is yours. Default is invite-only. open is a config line, not a hidden switch.
  • Retention is yours, including the choice to delete. Users who did not keep a copy lose the files.
  • Pubky TLS on 6287 removes the CA and the domain from the native path. It requires a stable public IP and an open port.
  • Ring grants are scoped, listed, and revocable. A cookie-era "log in once, every site on this homeserver shares the session" bug is the thing v0.10 was written to kill.
  • There is no token and no chain fee on the homeserver path. The cost is a VM, Postgres, and an address that does not move.

What it does not change

  • The operator is inside the trust boundary for every file, public or /priv/.
  • PKARR lookup leaks the key hash to DHT nodes. Tor in front of the lookup is the mitigation the Pubky note already records. This guide does not add a new one.
  • Ed25519 has no post-quantum replacement in this stack.
  • A homeserver does not give you a social graph. Nexus, or another indexer, does. That indexer can omit, reorder, and de-index.
  • Credible exit needs a second copy and a tool that republishes the PKARR record. Changing the record does not resurrect deleted files, and caches can serve the old locator after you move.
  • Cloudflare Tunnel is the easy NAT answer and the one deploy shape that drops Pubky TLS.

Attack surface

Boundary What an adversary gets What does not save you
Homeserver admin Every /pub/ and /priv/ file, quotas, signup tokens, the event stream including private events on the admin stream /priv/ capabilities. Those bind clients, not the operator.
Admin socket left on 0.0.0.0:6288 with password admin Full admin API The default bind is localhost. The deploy guide says not to widen it.
PKARR record A signed locator. Also a stale locator if public_ip changed or republish is off The signature. It does not authenticate file bytes.
DHT / relays Who looked up a key, and whether your record is being served Republish interval (4 hours default) does not hide queries.
HTTP relay during login Timing and channel id. Plaintext auth token if the app skips the client-secret encryption Ring never sends the identity private key to the relay. secret in the URL is the transport secret.
Malicious or over-scoped app Whatever capability the user approved, until that grant is revoked Device authentication. It does not recall a grant already accepted.
Browser IndexedDB Restore material for that origin, including encryption keys in the clear Sign-out on another machine. Local theft is local.
Nexus operator The feed, search, and any full-content copy they stored. A moderation key if they kept the sample. A trust-rank seed if they set one Fetching the app's API. Content attestation means fetching the homeserver yourself.
Primary-homeserver compromise Everything that indexer bulk-ingests from that server, on a 5-second poll in the default watcher config Blacklist. Blacklist applies to third-party keys, and the primary is excluded from that list so it is not double-indexed.
Invite token theft One account on your server, with the quotas baked into the token The 10/minute lookup limit. That slows guessing. It does not expire a leaked token.
IP-only ACME HTTPS dies if shortlived renewal fails for a few days. Pubky TLS can keep working if 6287 is still open Assuming "the site is down" means the native path is down.
Homeserver key loss (~/.pubky/secret) You cannot keep the same server identity User recovery phrases. Those are user keys.

Worst case for a hosted user: the operator keeps the files, alters the public ones, and the indexer the user's friends actually read never notices, because those friends asked Nexus instead of the homeserver. Worst case for an operator: you are now the custodian of other people's public speech and their unencrypted private files, on an address that PKARR publishes. Plan for both before you open signup.

Evidence at a glance

Claim Source Date read What it supports
Pubky TLS is port 6287; HTTPS is 443; 6286/6288/6289 stay private DEPLOY.md, ip-only.md 2026-11-10 Port and protocol split
Default signup mode is token_required config.default.toml, signup_mode.rs 2026-11-10 Invite gate is the default
GET /signup_tokens/* limited to 10/min/IP in the shipped config config.default.toml 2026-11-10 Invite guessing is rate-limited, not prevented
Static IP change silently kills the PKARR locator ip-only.md 2026-11-10 Why Pubky TLS wants a reserved address
Cloudflare Tunnel does not support Pubky TLS DEPLOY.md 2026-11-10 NAT-friendly deploy drops the native path
/priv/ is access control; admin can read it security model, PRIVATE_STORAGE.md 2026-11-10 Operator is inside the trust boundary
Signed discovery does not prove file authenticity security model 2026-11-10 PKARR is a locator, not a content log
Grant bearer is one hour; cookie auth is deprecated grant-auth.md 2026-11-10 Ring grant model
Local session delete does not revoke the grant authentication, grant-session-lifecycle.md 2026-11-10 Revocation is an explicit sign-out
Device auth does not revoke remote grants Ring security.md 2026-11-10 Phone lock is not a kill switch
App reads feeds from Nexus; writes under /pub/pubky.app/ pubky.app page 2026-11-10 App is not the source of truth
Index is a derived view; Nexus serves full content unless the client attests indexing page, Nexus README 2026-11-10 Indexer trust
Default watcher bulk-ingests Synonym HS 8um71us3fyw6h8wbcxb5ar3rwusy1a6u49956ikzojg3gcwd1dty nexus-watcher/default.watcher-config.toml 2026-11-10 Production-shaped default, not a neutral crawl
Trust rank seeds are empty until configured; alpha 0.35 nexus-common/src/config/trust.rs 2026-11-10 Ranking is an operator prior
Homeserver v0.18.0 published 2026-11-09; install guide sample still said 0.17.0 GitHub releases API; docs/INSTALL.md 2026-11-10 Do not copy the guide's pin
Server key loss is unrecoverable post-setup.md 2026-11-10 ~/.pubky/secret is the server identity

Primary sources

Also in Sovereign Naming

Page history

Updated
2026-11-10
Origin
Compiled from the ungovernable.tech research notes.
Improve this page
Suggest an edit — issues and pull requests are welcome.