How to Self-Host Paperclip

Paperclip is an open-source server and web app that runs a team of AI agents like a company: an org chart, goals, tasks, budgets and approvals, with Claude Code, Codex and other agents doing the work. You can run it on your own server. This guide covers the hand-built route with Docker and PostgreSQL, the settings that trip people up, and what a prepared server does for you instead.

What you are taking on

On a laptop, Paperclip starts with no setup at all: it creates an embedded PostgreSQL database and runs in local_trusted mode, which listens on localhost only and needs no login. A server is different. Once Paperclip is reachable from the internet it must run in authenticated mode with public exposure, and that mode needs an explicit public URL, a real database, stable secrets and HTTPS. None of it is hard, but every piece has to be right before the first sign-in. The server requirements guide covers sizing.

Option 1: Docker Compose by hand

Step 1: Get a server and a PostgreSQL 15+ database

Any Linux server with Docker will do. Paperclip's database must be PostgreSQL 15 or newer: public instances refuse the embedded database, and the schema migrations use NULLS NOT DISTINCT, which version 14 rejects. Paperclip's own Compose files and AWS guide use PostgreSQL 17. Size the database for connections, too: with default settings one Paperclip server process can open up to 73 of them, according to the project's database documentation.

Step 2: Generate the secrets

Three values must exist before the first start and stay the same afterwards. Generate each with openssl rand -hex 32 and keep them in an env file that only its owner can read:

  • BETTER_AUTH_SECRET signs login sessions.
  • PAPERCLIP_TOOL_ACTION_SIGNING_SECRET signs approvals for tool actions. Keep it independent from the session secret.
  • PAPERCLIP_SECRETS_MASTER_KEY encrypts the API keys and other secrets Paperclip stores. Without it Paperclip creates a key file under its data folder instead. Either way, losing the key means losing every stored secret.

Step 3: Write the Compose file

The project publishes its image as ghcr.io/paperclipai/paperclip. It listens on port 3100 and keeps its files (uploads, agent workspaces, the local secrets key) under /paperclip. A minimal file:

services:
  db:
    image: postgres:17
    restart: always
    environment:
      POSTGRES_USER: paperclip
      POSTGRES_PASSWORD: change-this-password
      POSTGRES_DB: paperclip
    volumes:
      - pgdata:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "paperclip"]
      interval: 5s
  paperclip:
    image: ghcr.io/paperclipai/paperclip:latest
    restart: always
    ports:
      - "127.0.0.1:3100:3100"
    env_file: .env
    environment:
      HOST: 0.0.0.0
      PAPERCLIP_HOME: /paperclip
      DATABASE_URL: postgres://paperclip:change-this-password@db:5432/paperclip
      PAPERCLIP_DEPLOYMENT_MODE: authenticated
      PAPERCLIP_DEPLOYMENT_EXPOSURE: public
      PAPERCLIP_PUBLIC_URL: https://agents.example.com
    volumes:
      - paperclip-data:/paperclip
    depends_on:
      db:
        condition: service_healthy
volumes:
  pgdata:
  paperclip-data:

The three secrets come from .env. PAPERCLIP_PUBLIC_URL matters more than it looks: Paperclip derives its sign-in base URL, its invite links and its allowed hostnames from it. Pass ANTHROPIC_API_KEY or OPENAI_API_KEY here if you want a key for every agent, or connect models later in the app; see connecting AI models. Note that the official image is large, close to 5 GB compressed, because it carries a remote sandbox pack and several agent CLIs.

Step 4: Put HTTPS in front

Run a reverse proxy on ports 80 and 443 that obtains a certificate and forwards to 127.0.0.1:3100. With Caddy that is two lines:

agents.example.com {
    reverse_proxy 127.0.0.1:3100
}

The address in the browser has to match PAPERCLIP_PUBLIC_URL exactly, scheme, host and port, because the sign-in library checks the origin of each request. A mismatch shows up as failed sign-ups rather than as an obvious error, so check this first when sign-in fails.

Step 5: Create the owner

Start the stack with docker compose up -d. The first start runs the database migrations. A public instance cannot be claimed from the browser; its setup screen points to a command that mints a one-time owner invite instead:

docker compose exec paperclip npx paperclipai auth bootstrap-ceo

Open the invite URL it prints, create your account, and you are the instance admin. Then create your company and hire your first agent.

Step 6: Lock down, back up and update

Anyone who reaches a public instance can create an account. An account without an invitation sees no company, but once your team is in, set PAPERCLIP_AUTH_DISABLE_SIGN_UP=true and invite people from the company settings instead. The security guide covers this in detail.

Paperclip writes logical database backups on a timer by default, but those do not include uploads, workspaces or the secrets key, so back those up as well. The backup and migration guide lists what lives where. To update, pull the new image tag and recreate the container after a backup; Paperclip releases use calendar versions such as 2026.1117.0.

Option 2: A prepared server

Hosting for Paperclip on Flux starts from the same Paperclip release with all of the above already done. Every deploy:

  • Generates the session secret, the tool-action signing secret, the master key and the database password once, and stores them in the app's specification, which is encrypted on the network.
  • Runs PostgreSQL 15 as a cluster on all three of your instances with automatic failover, and connects Paperclip to it.
  • Sets PAPERCLIP_PUBLIC_URL to your free .app.runonflux.io address with HTTPS, and changes it with your domain.
  • Creates the one-time owner invite for you; the panel shows the link.
  • Turns off Paperclip's anonymous telemetry.

The image is the upstream release copied into a slimmer base so that it fits Flux's image size limit. Claude Code and Codex are included; the Gemini, Kimi and OpenCode CLIs and the remote sandbox provider pack are not, so remote OpenCode and ACPX runs in external sandboxes are not available. We follow Paperclip's stable releases and test each image before publishing it.

TaskDocker Compose by handPrepared server
Server and DockerYou provision and patch itProvided on the Flux decentralized cloud
PostgreSQL 15+You run and back it upA cluster on three nodes with failover
SecretsYou generate and guard themGenerated at deploy, kept in the encrypted spec
HTTPS and public URLYour proxy and certificateFree address with HTTPS; custom domain by CNAME
Owner accountRun bootstrap-ceo yourselfOne-time invite shown in the panel
Model usageBilled by your AI providerBilled by your AI provider
Control of the hostFull, including the OSThe container and its settings

How to choose

Build it yourself if you already run servers, want other agent CLIs in the image, or need remote sandboxes. Choose a prepared server if you would rather spend the time on your agents than on a proxy and a database. The cost side is in what running Paperclip costs.

See the plans for Hosting for Paperclip on Flux, or read the server requirements first.

Frequently Asked Questions

Can I run Paperclip without Docker?

Yes. Paperclip is a Node.js server with a React UI, and its README documents running it from source with Node.js 24.11 or newer and pnpm. Docker is simply the easiest way to keep a server install reproducible, and the official image already contains the Claude Code and Codex command-line tools.

Why does Paperclip need PostgreSQL 15 or newer?

Two reasons. An instance in authenticated mode with public exposure does not use the embedded database, so it needs a real PostgreSQL server. And its migrations use NULLS NOT DISTINCT, which PostgreSQL 14 rejects, so 15 is the lowest version that works.

What happens if I change BETTER_AUTH_SECRET later?

It signs sessions, so changing it signs everyone out. The tool-action signing secret signs approvals, and Paperclip’s docs say to rotate it only after outstanding approvals are resolved. Generate both once and keep them.

Why can I not claim the instance from the browser?

Paperclip allows a browser claim only on private instances. A public instance uses the high-entropy invite from the bootstrap-ceo command instead, so whoever finds the address first cannot become the admin.

Does the prepared server run the official image?

It runs the official Paperclip release, copied unchanged into a smaller image so that it fits Flux’s image size limit. The remote sandbox provider pack and the Gemini, Kimi and OpenCode command-line tools are left out; Claude Code and Codex stay.

Who supports Paperclip itself?

The Paperclip project documents its features at docs.paperclip.ing. Our support covers the server, deployment, billing and domains on Hosting for Paperclip, not Paperclip’s own features.

Paperclip is open-source software (MIT) by the Paperclip project (https://github.com/paperclipai/paperclip). Flux is not affiliated with or endorsed by the Paperclip project.

Hosting for Paperclip on the decentralized cloud

Dedicated resources, a PostgreSQL 15 cluster on three nodes, HTTPS and your own domain. From $7.99/month.

Hosting for Paperclip on Flux

Your company of AI agents, open 24/7.

A product of Flux

Paperclip is open-source software (MIT) by the Paperclip project. Flux is not affiliated with or endorsed by the Paperclip project.

© 2026 InFlux Technologies. All rights reserved. v1.21.0