Deploy Paperclip
Run a team of AI agents: Claude Code, Codex and more, with Postgres
Just deployed
Just deployed
Deploy and Host Paperclip on Railway
Paperclip (MIT) runs a company of AI agents. You hire agents such as Claude Code, Codex, OpenCode or Gemini CLI, give them roles, managers and budgets, and assign them tasks. Each agent wakes on a heartbeat, works in its own workspace and reports back in the task thread.
This template runs Paperclip's official image, which already has those agent CLIs installed, in the login-required mode upstream documents for internet-facing servers, with a Railway Postgres for the data.
About Hosting Paperclip
Paperclip's docs say a public instance can't be claimed from the browser: the first admin needs a one-time invite from paperclipai auth bootstrap-ceo. The official image can't run that command as shipped, so this template adds one start step that creates the same invite and prints the link in the deploy logs of the paperclip service. Only members of your Railway project can read those logs.
When the deploy finishes, open the paperclip service, then Deployments, then the logs of the latest deploy, and look for the lines starting with [railway-bootstrap]. Open the link, create your account, and you're the instance admin. The link works once and expires after 72 hours. Until someone uses it, every restart prints a new link and cancels the old one; after that the step logs "instance already has an admin" and does nothing.
Then add your model credentials in Paperclip and hire your first agent. On a public instance Paperclip runs in strict secret mode, so API keys go into its encrypted secrets store and agents get references to them, not the raw values.
Before publishing I deployed the template and drove it through the API. /api/health answers without a login and the rest of the API returns 403. The invite link was in the logs; signing up and accepting it made me instance admin, and the same link returned 404 afterwards. A second account that signed up without an invite saw an empty company list. I created a company and a Claude Code agent, assigned it a task, and 33 seconds later it had commented on the task and marked it done. After a redeploy the companies were still there and no new invite was printed.
I routed Claude through OpenRouter for that test (Claude Haiku 4.5). With OpenRouter, Claude's default ACP engine stalled until the 5 minute timeout, and switching the agent's engine to cli fixed it. I haven't tested ACP with a direct Anthropic key or a Claude subscription. The first heartbeat cost $0.21, mostly from loading about 30,000 tokens of Paperclip context.
Common Use Cases
- Put several coding agents on one backlog, each with a role, a manager and a monthly budget
- Keep agents working on schedules while your laptop is off, and review their work in the task threads
Dependencies for Paperclip Hosting
Model access for the agents you hire: an Anthropic or OpenAI API key, a Claude or ChatGPT subscription login, or any provider OpenCode supports. The template itself asks for nothing at deploy time.
Deployment Dependencies
- Paperclip: https://github.com/paperclipai/paperclip
- Docs: https://github.com/paperclipai/paperclip/tree/master/docs
- Image:
ghcr.io/paperclipai/paperclip - The wrapper this template builds: https://github.com/dektionstudio/railway-template-images/tree/main/paperclip
Implementation Details
PAPERCLIP_DEPLOYMENT_MODE=authenticated # login required
PAPERCLIP_DEPLOYMENT_EXPOSURE=public # upstream's setting for internet-facing servers
PAPERCLIP_PUBLIC_URL=https://
DATABASE_URL=${{Postgres.DATABASE_URL}} # private network, no public database port
BETTER_AUTH_SECRET, PAPERCLIP_SECRETS_MASTER_KEY # generated per deploy
PAPERCLIP_MIGRATION_AUTO_APPLY=true
Postgres holds the board: companies, agents, tasks and the encrypted secrets. The volume at /paperclip holds agent workspaces, CLI logins (it's the home directory), uploads and Paperclip's own database backups. Keep PAPERCLIP_SECRETS_MASTER_KEY: secrets stored in Paperclip can't be decrypted without it.
Sign-up stays open so you can create the first account. Accounts without an invite can't see any company, but upstream's AWS guide goes further and sets PAPERCLIP_AUTH_DISABLE_SIGN_UP=true once the first account exists, then adds people with invites. I haven't tested invites with sign-up turned off.
The service builds from the newest Paperclip release. To pin one, set PAPERCLIP_VERSION (for example 2026.916.1) on the paperclip service; migrations run on start.
The paperclip service used 0.67 GB of RAM idle and up to 0.96 GB while one agent ran; Postgres used 0.30 GB. Railway's trial caps each service at 1 GB. One agent at a time fit in my test, but when two runs started together one of them died after a minute, most likely out of memory. If you want several agents working at once, use the Hobby plan.
Why Deploy Paperclip on Railway?
Agents in Paperclip work on heartbeats and schedules, so the server has to stay up, and here it has its own HTTPS address behind a login. Idle RAM for both services comes to about $10 a month; model calls are billed by your provider.
Template Content
