I built a pastebin last week.
Not because the world needed another one. There are plenty — Gist, Hastebin, Pastebin.com, PrivateBin, Opengist. Some have git integration. Some have OAuth. Some have elaborate GUIs with folders and tags and commenting systems.
I just wanted something simpler.
the problem with existing options
When I went looking for a self-hosted pastebin, I found tools that did too much. Version control systems pretending to be pastebins. Account systems for a tool that should be fire-and-forget. Feature-heavy interfaces that look like they were designed by committee.
I didn’t need any of that. I wanted to run pbnj myfile.py in my terminal and get a URL. That’s it. Paste code, get link, share with a friend. No git commits. No signing in. No navigating a web UI to create a “new snippet.”
So I built pbnj.
what it does
The name is a play on PB&J sandwiches — and it generates URLs to match. Instead of x7f9a2b3, you get crunchy-peanut-butter-toast. Memorable. Shareable. A little silly.
The workflow is straightforward:
pbnj script.py
# → https://pbnj.sh/crispy-bacon-sandwichThat URL is now on your clipboard. Paste it wherever you need to share code.
It runs on Cloudflare’s free tier — Pages for hosting, D1 for the database, Workers for the API. Globally distributed, fast everywhere, costs nothing. The math works out to about 100,000 pastes before you’d even think about storage limits. At 10 pastes a day, that’s 27 years.
the craft of building small things
I wrote recently about the craft — about how software engineering is like being a blacksmith or a tailor. You wake up, work on your craft, make things for people, and go home. The work is the point.
pbnj is that kind of project. It’s not going to change the world. It’s not a startup. It’s just a tool I wanted to exist, built with care.
Not every side project needs to scale to millions of users or solve a novel problem. Sometimes you just want to own your tools.
There’s something satisfying about running your own pastebin. The code lives on your GitHub. The data sits in your Cloudflare account. Nobody can shut it down or change the terms of service. It’s yours.
This is the same instinct that drives people to self-host their email, run their own git servers, or maintain personal wikis. It’s not always practical. But it’s meaningful in a way that’s hard to articulate.
keeping it minimal
The hardest part of building pbnj wasn’t the code. It was deciding what not to build.
No web editor. Use your terminal. No user accounts. Single auth key. No comments or discussions. It’s a pastebin, not a forum. No folders or organization. The homepage is your feed. No expiring pastes. Your code lives forever (or until you delete it).
Every feature I didn’t add made the tool simpler. Every complexity I avoided made it easier to maintain. The stack is Astro with Tailwind and shadcn/ui — not exactly spartan, but the constraints are in the product, not the implementation.
the aesthetic
I spent more time than I’d like to admit on the visual design. Twelve themes. Syntax highlighting for 100+ languages. A Paper.design-inspired interface with generous whitespace and soft shadows.
Why? Because pastebins don’t have to be ugly.
Most code-sharing tools look like they were designed in 2008 and never updated. Gray backgrounds, cramped text, walls of monospace font. Functional, sure. Pleasant to look at? Rarely.
I wanted pbnj to feel like opening a nicely typeset book. The code is the content. Everything else should get out of the way.
why build this?
Honestly? Because I wanted it to exist.
I use pastebins constantly — sharing error logs with colleagues, sending code snippets to friends, debugging issues over chat. Having my own felt right. Like having my own domain, or my own blog.
The world probably didn’t need another pastebin. But I did.
If you want to try it: pbnj.sh. Deploy your own with one click on Cloudflare — it takes about 60 seconds and handles everything automatically. Or just use the CLI.
npm install -g @pbnjs/cli
pbnj --init
pbnj your-file.pySpread the code.