ByteStash

GPL-3.0
Platform
Docker Web Self-hosted
Licence
GPL-3.0 Open source
ByteStash

ByteStash is a self-hosted home for code snippets: a pastebin that remembers what you pasted. Each entry keeps a title, a description, a language, a set of categories and one or more named code fragments, so a server file, its client counterpart and the config that ties them together can live in a single entry instead of three unrelated pastes. It runs as a Node.js service with a React front end, stores everything in SQLite by default (PostgreSQL optional), and sits behind your own reverse proxy.

Key Features

  • Several fragments per snippet — one snippet holds multiple named code blocks, each with its own language and filename
  • Monaco editor — the editor behind VS Code, with syntax highlighting for the languages you actually write, plus Markdown and Mermaid diagram rendering
  • Categories, search and filters — free-form category tags (with suggestions as you type), filter by language, search titles and content, and sort by newest or oldest
  • Private by default, shareable on purpose — snippets belong to an account; a share menu mints a link at /s/<id> that can require a signed-in user, expire after a set duration, and be revoked again. Shared snippets can also be embedded elsewhere through the embed endpoint
  • Local file import — create a snippet from an uploaded source file instead of copying and pasting it
  • Export — save a snippet as a styled image for a chat or a document, or download snippets as a zip archive
  • REST API with API keys — Swagger UI documents every endpoint at /api-docs, and keys are managed under Settings
  • MCP endpoint for AI assistants — a Streamable HTTP Model Context Protocol endpoint at /mcp lets Claude, ChatGPT and Perplexity list, read, create and update your snippets with the same API key
  • OpenID Connect single sign-on — optional OIDC login against Authentik, Authelia, Keycloak, Pocket ID and similar, with a configurable public URL and base path
  • Admin panel — manage users and shares from the web UI; the first admin is granted from the container CLI, and new sign-ups are never admins
  • SQLite or PostgreSQL — PostgreSQL is optional, with a built-in migration that carries users, snippets, shares and API keys across with their IDs intact
  • Eight interface languages — English, German, Spanish, Italian, Indonesian, Japanese, Russian and Chinese

Why Use It

Most pastebins optimise for the moment: paste text, get a link, forget it. ByteStash optimises for the archive. Snippets are filed by language and category, so six months later you search for the function you half remember and find it in seconds rather than scrolling a wall of pastes; and the same snippet lives in one place instead of being scattered across chat threads and notes.

It is also a private library rather than a public service. Nothing is visible to anyone unless you create a share link, and that link can expire or require a logged-in account. Account creation can be closed once your team has signed up, SSO can replace local passwords entirely, and the database file stays on your own disk.

Use Cases

  • A personal snippet library that survives reinstalls, editor changes and laptop replacements
  • A small team’s shared reference for configs, queries, deployment scripts and boilerplate
  • Handing a colleague a single snippet through an expiring link instead of pasting it into a chat that will be lost
  • Giving an AI assistant scoped read and write access to your own snippets through the MCP endpoint
  • Documenting a homelab with the actual working code next to the notes

Deployment

The published image is ghcr.io/jordan-dalby/bytestash:latest and the documented compose file is a single service with one volume at /data/snippets (SQLite database and JWT secret) and port 5000. Behaviour is configured with environment variables — ALLOWED_HOSTS, BASE_PATH, TOKEN_EXPIRY, ALLOW_NEW_ACCOUNTS, and the OIDC_* set for single sign-on. After signing up, promote the first admin from inside the container with docker compose exec bytestash node src/scripts/admin.js grant <username>. It is also packaged for the Unraid app store and as a PikaPods one-click install. The container speaks plain HTTP on 5000, so terminate TLS at your reverse proxy — remote MCP clients require HTTPS.

Alternatives

  • PrivateBin — zero-knowledge encrypted pastes with expiry; better when the goal is one-off secret sharing rather than a library
  • Wastebin — deliberately minimal Rust pastebin on SQLite, no accounts
  • MicroBin — tiny Rust pastebin with file uploads and URL shortening
  • rustypaste — single-binary Rust paste server with file uploads and expiry
  • Haste Server — minimal Node paste server for ephemeral text
  • FlashPaper — one-time, self-destructing links for passwords and secrets

Explore More Categories

Sign In

Register

Reset Password

Please enter your username or email address, you will receive a link to create a new password via email.