As a developer or homelab enthusiast, you're constantly reusing code snippets for your projects. But have you ever struggled to keep track of them all? Snippets can be scattered across multiple files, folders, and even different computers. This can lead to wasted time searching for that one specific snippet when you need it.

What is ByteStash?

ByteStash is a self-hosted code snippet management solution that empowers developers to centralize their code assets within a secure, controlled environment. With features like snippet creation, editing, and filtering, ByteStash provides an intuitive interface for organizing, tracking, and protecting your valuable code.

ByteStash Key Features

  1. Create and Edit Snippets: Easily add new code snippets or update existing ones with an intuitive interface.
  2. Filter by Language and Content: Quickly find the right snippet by filtering based on programming language or keywords in the content.
  3. Secure Storage: All snippets are securely stored in a sqlite database, ensuring your code remains safe and accessible only to you.

The Bytestash 1.5.0 release brings the following updates but keep in mind as of today the latest version is 1.5.6.

  • ByteStash is now multi-user! Users can create their own accounts to store snippets in their personal area
    • Single sign-on support for OIDC compatible apps, Authentik, Authelia, etc...
  • Public snippet view. Users can share their snippets to the public snippet view for others to find and use.
  • Snippets can be exported to JSON & imported again, great for sharing across ByteStash instances, where the existing sharing mechanism doesn't quite cut it
  • Docker secrets! Specify a path for your JWT_TOKEN instead of putting it directly into your setup command
  • General UX improvements overall, based on user feedback
🚀
Run your own instance of ByteStash for as little as $1/Month with PikaPods! – Start free with $5 welcome credit 🤗

Install ByteStash using Docker

If you don't have Docker installed and need help getting started, I recommend checking out our self-hosting guides for beginners. These guides cover the basics of setting up a small server to host apps using Docker. They're designed to help you get up and running smoothly, even if you're new to self-hosting.

Use the following Docker Compose:

services:
  bytestash:
    image: "ghcr.io/jordan-dalby/bytestash:latest"
    restart: always
    volumes:
      - /your/snippet/path:/data/snippets
    ports:
      - "5000:5000"
    environment:
      # See https://github.com/jordan-dalby/ByteStash/wiki/FAQ#environment-variables
      BASE_PATH: ""
      JWT_SECRET: your-secret
      TOKEN_EXPIRY: 24h
      ALLOW_NEW_ACCOUNTS: "true"
      DEBUG: "true"
      DISABLE_ACCOUNTS: "false"
      DISABLE_INTERNAL_ACCOUNTS: "false"

      # See https://github.com/jordan-dalby/ByteStash/wiki/Single-Sign%E2%80%90on-Setup for more info
      OIDC_ENABLED: "false"
      OIDC_DISPLAY_NAME: ""
      OIDC_ISSUER_URL: ""
      OIDC_CLIENT_ID: ""
      OIDC_CLIENT_SECRET: ""
      OIDC_SCOPES: ""

Final Notes and Thoughts

I've been searching for a reliable code snippet management tool, and it's refreshing to see a new contender emerge. After trying Snippet Box and Snibox, which both seemed abandoned years ago, I'm excited to discover ByteStash. Its development is a welcome respite from the lack of innovation in this space, and I'm eager to explore its features and benefits.

If you have any suggestions, issues, or just want to say thank you, head over to the ByteStash project page on GitHub and check it out. Be sure to give the project a star!