---
title: "Deploy MicroBin"
description: "Self-hosted pastebin and file sharing with password-protected uploads"
category: "Storage"
url: https://railway.com/deploy/microbin-1
---

# Deploy MicroBin

Self-hosted pastebin and file sharing with password-protected uploads

**[Deploy MicroBin on Railway](https://railway.com/template/microbin-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/microbin-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Storage

## Template content

### MicroBin https://cdn.jsdelivr.net/gh/selfhst/icons/svg/microbin.svg

- **Image:** danielszabo99/microbin:2.1.4@sha256:6660e5ccad0d764fa3c0032464ffb8f4b4f28c92a2eb9e39202b94cdc5b68909
- **Start command:** `/bin/sh -c 'set -e;: "${MICROBIN_ADMIN_PASSWORD:?MICROBIN_ADMIN_PASSWORD must be set}";: "${MICROBIN_UPLOADER_PASSWORD:?MICROBIN_UPLOADER_PASSWORD must be set}";export MICROBIN_PORT="${PORT:-8080}" MICROBIN_BIND=0.0.0.0;export MICROBIN_DATA_DIR="${MICROBIN_DATA_DIR:-/app/microbin_data}";export MICROBIN_ADMIN_USERNAME="${MICROBIN_ADMIN_USERNAME:-admin}";export MICROBIN_READONLY="${MICROBIN_READONLY:-true}";export MICROBIN_DEFAULT_PRIVACY="${MICROBIN_DEFAULT_PRIVACY:-unlisted}";export MICROBIN_DISABLE_TELEMETRY="${MICROBIN_DISABLE_TELEMETRY:-true}";export MICROBIN_QR="${MICROBIN_QR:-true}";mkdir -p "$MICROBIN_DATA_DIR";[ -f "$MICROBIN_DATA_DIR/database.sqlite" ] || echo H4sIAAAAAAACA+3XQUvDMBQH8HQIgjDwtmuOCuLFu1olyLBOrRXcQULWvkKwS0uajXV3L35qk4LTSll2Vd6PpjTNnzR96aVPj5E0QPNSz4WhZ+SQBAG5pJQQEtg2IN9cf+9X3ycgp+tq6C6G58QeCCGEEEIIIfRHvV8E+6PRKPh4NWJWQCVqI9rT4DpmYcJoEl5FjLa36NEB/UFmdDxJ2A2L6UM8vgvjKb1l05NOJi2VAWVowl4SOrm37TmKupFcFsCVmEMb6hmr5Rq+ntQdhpWdvJal2ja/BpHxUhXNZrX9uUrLpTDgSUEm20L5YirVTWV4DXoJesdwWkhXq53CkPE3aHpKltr3taO+WVaV1MK40m0PFnbjuSuhJ9dWOS0X3vXPFlpxkRvQ7bS1b1fch8dNU0F3jzehY/dvbn/6EUIIIYQQQggh9I99Ajf8NwIAIAAA | base64 -d | gzip -dc > "$MICROBIN_DATA_DIR/database.sqlite";exec microbin'`
- **Health check:** /
- **Public domain:** Yes

## Documentation

# Deploy and Host MicroBin on Railway

MicroBin is a small, self-hosted pastebin and file-sharing web app written in Rust. You can share text, code with syntax highlighting, files and short URLs through one link, with optional expiry, burn-after-reading and password encryption. It runs as a single binary with an SQLite database.

## About Hosting MicroBin

MicroBin needs one container, a persistent folder for its SQLite database and uploaded files, and a public HTTPS address. This template runs the official `danielszabo99/microbin` image (version 2.1.4, pinned by digest) with a Railway volume at `/app/microbin_data` and a Railway domain. On first deploy it generates two passwords: one for the admin page and one that is required to create pastes, so strangers can't use your instance to host files. Anyone with a paste's link can still view it. Links and QR codes use your Railway domain, and telemetry is turned off.

## Common Use Cases

* Share code snippets, logs or config files with a teammate through a short link
* Send files or screenshots that expire after a set time or after being read
* Keep a private, self-hosted alternative to public pastebin and file-drop sites

## Dependencies for MicroBin Hosting

* The official MicroBin Docker image (`danielszabo99/microbin:2.1.4`)
* A Railway volume for the SQLite database and uploaded files

### Deployment Dependencies

* MicroBin source and docs: https://github.com/szabodanika/microbin
* Release 2.1.4: https://github.com/szabodanika/microbin/releases/tag/v2.1.4
* Configuration options: https://microbin.eu/docs/installation-and-configuration/configuration
* Docker image: https://hub.docker.com/r/danielszabo99/microbin

### Implementation Details

**First login.** Open the service's Variables tab on Railway. `MICROBIN_UPLOADER_PASSWORD` is what you type in the "Uploader Password" box when you create a paste. `MICROBIN_ADMIN_PASSWORD` (user `admin`) opens the `/admin` page, which lists every paste and shows the active settings.

**Defaults set by the start command.** Each one can be changed by adding the variable to the service:

| Variable | Default | Effect |
|---|---|---|
| `MICROBIN_READONLY` | `true` | Required for MicroBin to check the uploader password. Set it to `false` to let anyone upload |
| `MICROBIN_DEFAULT_PRIVACY` | `unlisted` | New pastes stay off the public `/list` page unless the uploader picks "Public" |
| `MICROBIN_DISABLE_TELEMETRY` | `true` | No usage data is sent to the MicroBin project |
| `MICROBIN_QR` | `true` | Shows a QR code for each paste |
| `MICROBIN_ADMIN_USERNAME` | `admin` | User name for the admin page |

Other options, such as `MICROBIN_TITLE`, `MICROBIN_DEFAULT_EXPIRY`, `MICROBIN_MAX_EXPIRY` or `MICROBIN_MAX_FILE_SIZE_UNENCRYPTED_MB`, are listed in the configuration docs linked above.

**Privacy.** MicroBin paste IDs are short (three animal names, about 65,000 combinations), so an "unlisted" paste is hidden from the list but its link can be guessed. For anything sensitive, choose "Private" (encrypted on the server with a password) or "Secret" (encrypted in your browser) when you create the paste.

**Database fix.** MicroBin 2.1.2 to 2.1.4 create a fresh SQLite table whose column order doesn't match the code that loads it, so after a restart the admin page and the list show no pastes and extra attachments go missing (upstream issue #358). Before the first start, the start command writes an empty database with the column order that installs upgraded from 2.1.0 use, which loads correctly. It never touches an existing database.

**Known upstream issue.** In 2.1.2 and later, a large upload that takes a long time can lose its file if someone opens another paste while it is still uploading (upstream issue #370).

## Why Deploy MicroBin on Railway?


Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying MicroBin on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.



## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/microbin-1
