---
title: "Deploy PrivateBin"
description: "Zero-knowledge encrypted pastebin with expiring share links"
category: "Storage"
url: https://railway.com/deploy/privatebin-2
---

# Deploy PrivateBin

Zero-knowledge encrypted pastebin with expiring share links

**[Deploy PrivateBin on Railway](https://railway.com/template/privatebin-2)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/privatebin-2/manifest.json

- **Creator:** INAPP
- **Category:** Storage

## Template content

### privatebin

- **Source:** https://github.com/INAPP-Mobile/privatebin
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host

[![Deploy on Railway](https://railway.app/button.svg)](https://railway.com/deploy/privatebin-2?utm_campaign=privatebin)

![PrivateBin paste form](https://raw.githubusercontent.com/INAPP-Mobile/privatebin/main/assets/privatebin-ui.png)

PrivateBin is a minimalist, open-source online pastebin where the server has zero knowledge of pasted data — text is encrypted and decrypted in the browser using 256-bit AES, so the server never sees the plaintext. This template ships PrivateBin 2.1.1 (Zlib license) pinned by digest as a single service with pastes on a persistent volume — no database, no accounts, no setup — so the deploy form has zero fields.

## About Hosting

One click deploys a single PrivateBin service with a persistent volume at `/srv/data`. Pastes and comments live on the volume — no separate database service to wire up. The first boot lands straight on the working paste form; there is nothing to configure. Railway's injected `PORT` is honored on every boot, the rate limiter reads the real visitor IP from `X-Forwarded-For`, and the public URL is derived from the live domain.

What gets deployed:

- **privatebin** — PrivateBin 2.1.1 (nginx + PHP-FPM 8.5) with filesystem storage, volume `/srv/data`

## Why Deploy

- **Zero-knowledge by design:** pastes are encrypted in the browser with 256-bit AES — the server stores ciphertext only.
- **Zero-fuss start:** no database, no accounts, no wizard — the first boot is already a working pastebin.
- **Always-on by design:** the pastebin runs continuously, so your links stay live.

## Common Use Cases

- Share code snippets, logs, or config with a link that expires on its own.
- Pass secrets or credentials to a teammate without leaving them in chat history.
- Host a team pastebin with discussion, password protection, and burn-after-reading.
- Replace a public paste service with one where the server never sees plaintext.

## Dependencies for PrivateBin Hosting

- The privatebin service with a volume at `/srv/data`, created by the template. A custom domain is optional.

### Deployment Dependencies

| Setting | Value |
|---|---|
| Runtime | PrivateBin 2.1.1 (nginx + PHP-FPM 8.5 on Alpine) |
| Plan | Hobby; one service |
| Port | Railway's injected `PORT`, honored on every boot (default 8080) |
| Persistence | One Railway volume at `/srv/data` |
| Healthcheck | `/` (paste form, unauthenticated 200 when nginx + PHP-FPM are up) |

| Variable | Value | Notes |
|---|---|---|
| `PORT` | _(injected by Railway)_ | nginx is remapped to it on every boot |
| `RAILWAY_PUBLIC_DOMAIN` | _(derived at boot)_ | PrivateBin's `basepath` is re-derived from it on every boot |
| `CONFIG_PATH` | `/srv/cfg` | Baked in the image; where PrivateBin reads `conf.php` |

Pinned in `conf.php` (baked into the image): Filesystem model, pastes at `/srv/data`, 10 MB size limit, 1-week default expiry (5 min – 1 year + never), discussion and password protection on, file upload off, rate limit 10 s per IP keyed on `X-Forwarded-For`.


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — Time-series analytics on PostgreSQL: fast, familiar, scalable.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/privatebin-2
