Skip to content
/ pbnj Public
forked from bhavnicksm/pbnj

🥪 Want your own Paste Bin that jelly-s well with your workflow? ✨ You've come to the right place!

License

Notifications You must be signed in to change notification settings

xoho/pbnj

 
 

Repository files navigation

pbnj logo

🥪 pbnj 📄

npm version npm downloads npm bundle size GitHub stars GitHub forks Docs License

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

Deploy to Cloudflare

✨ Features

  • 🎨 Syntax highlighting for 100+ languages with 12 beautiful themes
  • 🧹 Clean interface — distraction-free, minimal design
  • 🥪 Memorable URLscrunchy-peanut-butter-sandwich instead of x7f9a2
  • ⌨️ CLI-firstpbnj file.py and 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
Flexoki Light Flexoki Dark
GitHub Light GitHub Dark
GitHub Light GitHub Dark
Gruvbox Light Gruvbox Dark
Gruvbox Light Gruvbox Dark
Nord Dracula
Nord Dracula
Catppuccin Latte Catppuccin Frappé
Catppuccin Latte Catppuccin Frappé
Catppuccin Macchiato Catppuccin Mocha
Catppuccin Macchiato Catppuccin Mocha

🙋🏻‍♀️ Why?

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

💰 Cost

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.

⚡ Speedrun: Get Started Under a Minute!

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!

deploy

Step 2: Install the CLI

npm install -g @pbnjs/cli

Step 3: Configure it

pbnj --init
# Enter your worker URL and AUTH_KEY

Step 4: Paste!

pbnj myfile.py
# → https://your-pbnj.workers.dev/crunchy-peanut-butter-sandwich

That's it. You now have your own pastebin.

See cli/README.md for full CLI documentation.

🚫 Intentionally Missing

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.

🙏 Acknowledgements

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.


If pbnj made your life a little easier, consider giving it a star ⭐

It helps others discover the project and makes me mass smile :)

Star on GitHub

About

🥪 Want your own Paste Bin that jelly-s well with your workflow? ✨ You've come to the right place!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Astro 32.8%
  • TypeScript 30.1%
  • JavaScript 22.6%
  • CSS 14.5%