ByteStash
Overview
ByteStash is an open-source, self-hosted code snippet manager for developers and teams. Store, organize, tag and search reusable code snippets with syntax highlighting through the Monaco editor, render Markdown and Mermaid diagrams, keep multi-file snippets, and share snippets publicly with optional expiry.
The SecureAnyCloud image builds ByteStash from source under /opt/bytestash. It runs the Node.js server as the dedicated bytestash system user, bound to loopback 127.0.0.1:5000, and fronts it with nginx on port 80, ready for your TLS certificate.
What you get:
- ByteStash built from source under
/opt/bytestash(Node.js server + React client) - Authentication with username and password using JSON Web Tokens, plus per-user API keys, optional OIDC single sign-on and a remote MCP endpoint for AI assistants
- Embedded SQLite database at
/opt/bytestash/data/snippets/snippets.db(no separate database to run) bytestash.servicerunning asbytestash, bound to127.0.0.1:5000- nginx reverse proxy on port 80, ready for TLS
bytestash-firstboot.servicefor the per-VM JWT secret and seeded admin- No known bootstrap credential. The image ships with an empty database and a temporary secret. On the first boot of every instance,
bytestash-firstboot.servicegenerates a unique JWT signing secret, seeds the initial administrator account with its own random password, and writes both to/root/bytestash-credentials.txt(readable only by root). Open self-registration is disabled, so no world-open sign-up window is ever exposed. - Node.js 22 LTS runtime
- Ubuntu 24.04 LTS base, patched at build time
- 24/7 SecureAnyCloud support, 24h response SLA
Prerequisites
You need an active Azure subscription, an SSH key pair, and a VNet with a subnet.
The recommended VM size is Standard_B2s. ByteStash is lightweight, and 4 GB RAM is comfortable.
Deploy from the Azure Portal
Search the Marketplace for ByteStash on Ubuntu 24.04 and choose your VM size.
Attach a network security group (NSG) that allows TCP 22 (SSH) from your management network and TCP 80 / 443 (the web app) from the networks that need it. In production, front port 80 with TLS (see Enable HTTPS below).
Deploy from the Azure CLI
RG="bytestash-prod"; LOCATION="eastus"; VM_NAME="bytestash-01" IMAGE_URN="sac1647283583153:bytestash-ubuntu-24-04:default:latest" SSH_KEY="$(cat ~/.ssh/id_rsa.pub)" az group create --name "$RG" --location "$LOCATION" az network vnet create -g "$RG" --name bs-vnet --address-prefix 10.90.0.0/16 --subnet-name bs-subnet --subnet-prefix 10.90.1.0/24 az network nsg create -g "$RG" --name bs-nsg az network nsg rule create -g "$RG" --nsg-name bs-nsg --name allow-ssh --priority 100 \
--source-address-prefixes "<your-mgmt-cidr>" --destination-port-ranges 22 --access Allow --protocol Tcp az network nsg rule create -g "$RG" --nsg-name bs-nsg --name allow-web --priority 110 \
--source-address-prefixes "<your-mgmt-cidr>" --destination-port-ranges 80 443 --access Allow --protocol Tcp
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:bytestash-ubuntu-24-04:default:latest
az vm create -g "$RG" --name "$VM_NAME" --image "$IMAGE_URN" \
--size Standard_B2s --storage-sku StandardSSD_LRS \
--admin-username azureuser --ssh-key-values "$SSH_KEY" \
--vnet-name bs-vnet --subnet bs-subnet --nsg bs-nsg --public-ip-sku StandardConnect via SSH
ssh azureuser@<vm-ip>Verify the services are running
ByteStash listens on loopback 127.0.0.1:5000. nginx fronts the web app on port 80.
sudo systemctl is-active bytestash nginx ss -tln | grep -E ':80 |127.0.0.1:5000' curl -s -o /dev/null -w 'GET /api/auth/config -> HTTP %{http_code}\n' http://127.0.0.1/api/auth/configBoth services report active, the Node server is bound to 127.0.0.1:5000, nginx is bound to :80, and the auth config API returns HTTP 200 through nginx.
Read your per-VM administrator credentials
There is no default login. On first boot, a unique administrator password and JWT secret were generated for this instance and written to a root-only file. Open self-registration is disabled, so the seeded admin is the only account until you create more.
sudo stat -c '%n perms=%a owner=%U:%G' /root/bytestash-credentials.txt
sudo grep -E '^BYTESTASH_URL|^BYTESTASH_USERNAME' /root/bytestash-credentials.txt curl -s http://127.0.0.1/api/auth/config echo curl -s -o /dev/null -w 'unauthenticated GET /api/snippets -> HTTP %{http_code}\n' http://127.0.0.1/api/snippetsThe credentials file is 600 root:root. The auth config reports "allowNewAccounts":false (self-registration disabled) with "hasUsers":true, and an unauthenticated API call is refused with HTTP 401.
Read your admin password with sudo grep '^BYTESTASH_ADMIN_PASSWORD' /root/bytestash-credentials.txt.
Log in to the web UI
Open http://<vm-ip>/ in your browser. ByteStash shows its sign-in page. Enter the username admin and the password from /root/bytestash-credentials.txt, then click Login.
After you log in, you land on your snippet library. It starts empty. Click New Snippet to add your first snippet.
Create a snippet
Give the snippet a title and description. Add one or more code fragments, each with a language for syntax highlighting, and tag the snippet for search. Then save.
The snippet appears in your library with Monaco syntax highlighting and is instantly searchable by title, content or tag.
The runtime stack
node -v nginx -v test -f /opt/bytestash/client/build/index.html && echo "client build present" test -f /opt/bytestash/server/src/app.js && echo "server present"Node.js 22 LTS runs the server and nginx 1.24 fronts it. Both the built React client and the Node server are present on disk.
Data and persistence
All snippets, users and settings live in the embedded SQLite database under /opt/bytestash/data/snippets, captured into the image and carried onto every instance.
sudo ls -lh /opt/bytestash/data/snippets/snippets.db test -f /var/lib/sac/data/bytestash-firstboot.done && echo "firstboot: completed" apt-mark showholdThe database file is present, and the first-boot marker confirms that the per-VM secret and admin were provisioned. There are no held packages, so the OS security baseline is intact.
Enable HTTPS
nginx already fronts ByteStash on port 80 and is ready for TLS. Point a DNS record at your VM, then obtain a certificate with certbot:
sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d <your-domain> --agree-tos -m <your-email> --redirectcertbot installs the certificate, rewrites the nginx server block for TLS, and sets up automatic renewal. Your snippet library is then served over HTTPS.
Optional: enable OIDC single sign on
ByteStash supports OIDC single sign-on. Set the OIDC variables in /etc/bytestash/bytestash.env and restart the service:
if
sudo grep -q '^OIDC_ENABLED=' /etc/bytestash/bytestash.env; then
sudo sed -i 's/^OIDC_ENABLED=.*/OIDC_ENABLED=true/' /etc/bytestash/bytestash.env else echo 'OIDC_ENABLED=true' | sudo tee -a /etc/bytestash/bytestash.env fi
# then add OIDC_ISSUER_URL, OIDC_CLIENT_ID and OIDC_CLIENT_SECRET for your provider
sudo systemctl restart bytestashAsk your identity provider for the issuer URL and client credentials. Internal username and password accounts continue to work alongside OIDC unless you disable them.
Managing the service
sudo systemctl status bytestash
sudo systemctl restart bytestash
sudo journalctl -u bytestash -fThe Node server logs to the journal. nginx logs are under /var/log/nginx/.
To back up the instance, snapshot the OS disk, or copy /opt/bytestash/data/snippets while the service is stopped.
Support
SecureAnyCloud provides 24/7 support for this image via email and live chat. Support covers deployment, nginx TLS termination, upgrades, OIDC integration and performance tuning. Email sales@secureanycloud.com.
This is a repackaged open source software product with additional charges for SecureAnyCloud support services. ByteStash is a trademark of its respective owner. All product and company names are trademarks or registered trademarks of their respective holders. Their use does not imply any affiliation with or endorsement by them.
Deploy on Azure
Launch ByteStash on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
ByteStash is a free, open-source, self-hosted code snippet manager for developers and teams. Store, organize, tag and full-text search reusable code snippets with syntax highlighting for dozens of languages, Markdown and Mermaid rendering, multi-file snippets, and shareable links with optional expiry.
This SecureAnyCloud image runs ByteStash, built from source, as a Node.js service under systemd. It is bound to the loopback address 127.0.0.1:5000 and fronted by an nginx reverse proxy on port 443 with a self-signed certificate generated per instance. The embedded SQLite datastore lives on a dedicated data volume mounted at /var/lib/bytestash.
A unique administrator account, JWT signing secret and TLS certificate are generated on the first boot of every instance. No shared or default credential and no world-open sign-up window ship in the image.
What you get:
- ByteStash 1.5.12 (Node.js server + React client) managed by systemd, serving a full web UI
- nginx on port 443 (TLS) fronting the application, which is bound to the loopback address
127.0.0.1:5000. Port 80 redirects to 443. - A self-signed TLS certificate generated per instance, ready to be replaced with your own domain certificate
- Open self-registration disabled, so the seeded administrator is the only account until you create more
- A unique admin password and JWT signing secret generated on first boot and recorded in a root-only file
- A dedicated data volume at
/var/lib/bytestashholding the SQLite datastore bytestash.serviceandnginx.serviceas systemd units, enabled and active- 24/7 SecureAnyCloud support
Prerequisites
You need an AWS account, an EC2 key pair in the target Region, and a VPC with a public subnet.
The recommended instance type is m5.large (2 vCPU / 8 GiB RAM). Configure the security group to allow inbound 22/tcp from your management network for SSH and 443/tcp for the HTTPS web UI. The application port 5000 is bound to loopback only and is never exposed.
Step 1 - Launch the AMI
Subscribe to the listing in AWS Marketplace and choose Continue to Launch. Launch through the EC2 console or the AWS CLI. Select the m5.large instance type, your key pair, and a security group that opens ports 22 and 443.
On first boot, the instance generates its per-VM JWT secret and TLS certificate and seeds the administrator account. It then brings up ByteStash behind nginx and writes your credential to a root-only file.
Step 2 - Connecting to your instance
Connect over SSH as the default login user for the OS variant you launched:
OS variant SSH login user
Ubuntu 24.04 ubuntu
ssh -i /path/to/your-key.pem ubuntu@<public-ip>Step 3 - Read your per-instance credential
The administrator username and password are unique to each instance and written to a root-only file:
sudo cat /root/bytestash-credentials.txtBYTESTASH_URL=https://<instance-public-ip>/ BYTESTASH_USERNAME=admin BYTESTASH_ADMIN_PASSWORD=<your-per-vm-password> NOTE=Log in at BYTESTASH_URL with BYTESTASH_USERNAME and BYTESTASH_ADMIN_PASSWORD. Rotate the password from the account menu after first login.Step 4 - Confirm the services and the loopback binding
Both units should be active, the application should listen on loopback only, and nginx should hold ports 80 and 443:
systemctl is-active bytestash nginxactive activesudo ss -tlnp | grep -E ':5000|:443'LISTEN 0 511 127.0.0.1:5000 0.0.0.0:* LISTEN 0 511 0.0.0.0:443 0.0.0.0:*The application is reachable only through the nginx TLS proxy. Nothing is served from 5000 to the network.
Step 5 - Confirm authentication from the command line
The image is secure by default. Unauthenticated API requests are refused, and the per-instance admin credential authenticates end to end. Because the certificate is self-signed, curl needs -k (or your own trusted certificate):
# Unauthenticated requests are refused curl -ks -o /dev/null -w '%{http_code}\n' https://127.0.0.1/api/snippets
# -> 401
# Log in with your per-instance credential and capture the JWT
PW=$(sudo grep '^BYTESTASH_ADMIN_PASSWORD=' /root/bytestash-credentials.txt | cut -d= -f2-)
TOK=$(curl -ks -X POST https://127.0.0.1/api/auth/login \
-H 'Content-Type: application/json' \
-d "{\"username\":\"admin\",\"password\":\"$PW\"}" | python3 -c 'import json,sys;print(json.load(sys.stdin)["token"])')
# The token is valid and carries admin authorization curl -ks https://127.0.0.1/api/auth/verify -H "bytestashauth: Bearer $TOK"
# -> {"valid":true,...,"is_admin":true}
# Authenticated snippet listing succeeds curl -ks -o /dev/null -w '%{http_code}\n' https://127.0.0.1/api/snippets -H "bytestashauth: Bearer $TOK"
# -> 200Step 6 - Sign in to the web UI
Open https://<instance-public-ip>/ in your browser. The certificate is self-signed per instance, so your browser warns on the first visit. Proceed, or install the instance's certificate, or replace it with your own for production.
Sign in with the admin username and the password from the credentials file.
After you sign in, you land on the snippet dashboard, which lists your snippets with syntax highlighting, tags and full-text search:
Step 7 - Create and view snippets
Click New snippet to add a snippet with a title, a description, categories and one or more code fragments. Toggle Make snippet public only if you want an unauthenticated share link.
Open any snippet to view it with language syntax highlighting, copy it to your clipboard, or open the raw content. To find snippets quickly, use the search box (type # to browse categories) and the language filter.
Step 8 - Confirm the dedicated data volume
The SQLite datastore lives on its own EBS volume, separate from the OS disk. You can resize and snapshot it independently:
findmnt -no SOURCE,TARGET,FSTYPE /var/lib/bytestash/dev/nvme1n1 /var/lib/bytestash ext4Security notes
- No default credentials. The administrator password and the JWT signing secret are generated on each instance's first boot. Nothing is baked into the image. Rotate the password from the account menu after your first login.
- Open registration disabled. ByteStash permits only the first account to be created. Once the admin is seeded, the registration endpoint returns
403, so there is no world-open sign-up window. - Loopback binding and TLS. The application binds to
127.0.0.1:5000and is reachable only through the nginx TLS proxy. The security group opens only SSH and HTTPS. - Replace the certificate for production. The per-instance certificate is self-signed. For a trusted connection, point nginx at your own domain certificate (for example with Certbot), or terminate TLS at an Application Load Balancer.
- Optional OIDC single sign-on. ByteStash supports OIDC (
OIDC_ENABLEDplus issuer and client settings in/etc/bytestash/bytestash.env). It ships disabled. Contact support for help enabling it.
Backups
Back up your snippet library with EBS snapshots or AWS Backup against the /var/lib/bytestash data volume, or export snippets from the UI (Settings -> Data management -> Export Snippets).
Support
SecureAnyCloud provides 24/7 technical support for this product by email and live chat at sales@secureanycloud.com . Support covers deployment, replacing the self-signed certificate with your own domain and certificate, OIDC configuration, and backup planning for your snippet library.
For refund requests, contact sales@secureanycloud.com with your AWS account ID and subscription details.
Deploy on AWS
Launch ByteStash with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com