pbnj is a simple, minimal self-hosted pastebin solution, focused on getting you started quickly and easily
Features · Why? · Cost · Speedrun · Not a Feature · Acknowledgements
- 🎨 Syntax highlighting for 100+ languages with 12 beautiful themes
- 🧹 Clean interface — distraction-free, minimal design
- 🥪 Memorable URLs —
crunchy-peanut-butter-sandwichinstead ofx7f9a2 - ⌨️ CLI-first —
pbnj file.pyand you're done - 🌐 Web interface — create and delete pastes from the browser too
- 🔒 Private pastes — unlisted pastes with optional secret keys
- ☁️ Edge-powered — fast globally, free forever on Cloudflare
- ...and many more!
🎭 Theme Gallery
![]() |
![]() |
| Flexoki Light | Flexoki Dark |
![]() |
![]() |
| GitHub Light | GitHub Dark |
![]() |
![]() |
| Gruvbox Light | Gruvbox Dark |
![]() |
![]() |
| Nord | Dracula |
![]() |
![]() |
| Catppuccin Latte | Catppuccin Frappé |
![]() |
![]() |
| Catppuccin Macchiato | Catppuccin Mocha |
Another pastebin? Really?
When I wanted to self-host a pastebin, I found plenty of options—but they were all too much. Git-based version control, OAuth, elaborate GUIs. I just wanted something I could deploy in under a minute with a CLI that actually works.
So I built this.
Why not Gist? Maybe you want to own your data. Maybe you don't want to depend on GitHub. Maybe you just like self-hosting things. Or maybe you're a little autistic like me and enjoy having your own stuff :)
What makes pbnj different:
- Actually beautiful — most feature-heavy pastebins look ugly
- Deploy in seconds with one click
- CLI-first workflow (
pbnj file.py→ done) - No accounts, no git, no bloat
- Just paste and share
- Cloudflare's free tier will last you forever
Now, I know some people might wonder, "This is deployed on Cloudflare, they might charge us eventually!" That's why I wrote this section. Let's do some basic math to figure out how much storage we can use:
Cloudflare D1 Free Tier:
- 500 MB storage
- 5 million reads/day
- 100,000 writes/day
Typical paste sizes:
- Small snippet: ~500 bytes
- Medium file: ~2-5 KB
- Large file: ~10-20 KB
- Average: ~5 KB
The math:
- 500 MB ÷ 5 KB = ~100,000 pastes
- At 10 pastes/day = 27+ years of storage
- At 50 pastes/day = 5+ years of storage
For personal use, you'll never hit these limits. Even if you somehow do, D1's paid tier is just $0.75/GB-month. You'd need to be running a pretty popular pastebin to spend more than a few cents.
TL;DR: Cloudflare's free tier is more than enough. Stop worrying and start pasting.
Step 1: Click the deploy button above and follow the prompts. The most important here is to set the AUTH_KEY because you'd need that to make the pastes. Once you've clicked deploy, it takes about 25-30 seconds and your deployment will be ready!
Step 2: Install the CLI
npm install -g @pbnjs/cliStep 3: Configure it
pbnj --init
# Enter your worker URL and AUTH_KEYStep 4: Paste!
pbnj myfile.py
# → https://your-pbnj.workers.dev/crunchy-peanut-butter-sandwichThat's it. You now have your own pastebin.
See cli/README.md for full CLI documentation.
pbnj is opinionated. These features are not bugs—they're deliberate choices to keep things simple:
- No git integration — It's a pastebin, not a repository.
- No OAuth/accounts — Single user, single auth key. Done.
- No multi-user support — Fork it and run your own.
- No comments/discussions — Share code, not conversations.
- No folders/organization — The homepage is your feed.
- No expiring pastes — Your pastes live forever (or until you delete them).
If you need these features, check out Opengist or PrivateBin—they're great projects that take a different approach.
pbnj stands on the shoulders of giants. Shoutout to these awesome projects:
- Opengist — A self-hosted pastebin powered by Git
- PrivateBin — A minimalist, open source online pastebin with encryption
- Hastebin — The OG open source pastebin
- 0x0.st — The no-bullshit file hosting and URL shortener
- Cloudflare Workers — For making serverless actually simple
- Astro — The web framework that makes this possible
And to everyone who's ever pasted code to share with a friend—you're the reason this exists.













