Overview: MicroBin is a minimal, self-hosted paste bin and URL shortening service written in Rust that combines secure file sharing with simple text pasting and URL redirection. Designed for developers and sysadmins who need a lightweight, dependency-free solution to share code snippets, files, or links without relying on third-party services. With its single-binary deployment and low resource footprint (just a few MB of memory), MicroBin is ideal for personal use, internal teams, or small-scale deployments where privacy and control matter. It supports both text and binary file uploads with client- and server-side encryption options, making it suitable for sharing sensitive data without exposing it to public paste services.
The app uses animal names (64 unique options) for upload identifiers instead of random strings, improving usability and memorability. It runs as a standalone executable with no external dependencies, supports SQLite or JSON databases, and includes built-in dark mode, custom CSS styling via water.css, and QR code generation for easy access. MicroBin is perfect for users who want a simple, secure alternative to Pastebin or Bitly without the bloat.
What You Get
- Single-file executable - MicroBin compiles into a single binary with no external dependencies, making deployment and maintenance trivial across any Linux/macOS/Windows system.
- Client- and server-side encryption - Uploads can be encrypted on the client side before transmission, ensuring only those with the decryption key can read the content.
- File uploads and raw serving - Users can upload any file (text, images, zip files) and access them via raw URLs like
server.com/raw/pig-dog-cat for direct downloads or embedding.
- Animal-based identifiers - Uploads use memorable animal names (e.g.,
pig-dog-cat) instead of random hashes, improving usability and reducing errors when sharing links.
- URL shortening and redirection - MicroBin can shorten any external URL (e.g.,
server.com/shortlink) and redirect users, acting as a private Bitly alternative.
- SQLite and JSON database support - Choose between lightweight SQLite or file-based JSON storage for metadata, eliminating the need for a full database server.
- Private and public uploads - Uploads can be configured as private (only accessible with the link), public, editable, uneditable, or set to auto-expire or never expire.
- QR code generation - Each upload URL comes with an embedded QR code for quick scanning from mobile devices, ideal for sharing files between desktop and server.
- Dark mode and custom styling - Built-in dark mode with support for custom CSS via vanilla JavaScript and water.css, requiring no frontend frameworks.
Common Use Cases
- Building a secure internal code snippet sharing tool - Developers use MicroBin to share multi-line configuration files, error logs, or API keys securely within their team without exposing them to public pastebins.
- Sharing large files over email or chat - Users upload video files, ZIP archives, or screenshots too big for Discord/Slack via MicroBin and share the short link instead.
- Problem → Solution flow: Need to send a config file from server to laptop? - Use
curl -F "file=@config.json" http://localhost:8080/upload to upload directly from terminal, then scan the QR code on your phone to download it.
- DevOps teams managing ephemeral deployments - Operations teams use MicroBin as a quick file postbox to share temporary logs, build artifacts, or test configurations between containers and hosts without mounting volumes.
- Personal note-taking and quick file drops - Users run MicroBin on a Raspberry Pi at home to take notes or drop files from their phone without signing up for cloud services.
- URL shortening for internal tools - Sysadmins use MicroBin to shorten links to internal dashboards, CI/CD logs, or monitoring pages for easy sharing in tickets and documentation.
Under The Hood
MicroBin is a self-hosted paste service built in Rust that emphasizes simplicity, privacy, and minimal resource usage. It offers a lightweight alternative to mainstream paste services with features like file uploads, encryption support, and an admin interface for management.
Architecture
MicroBin adopts a modular monolithic architecture with well-defined layers and responsibilities. The application structure promotes separation of concerns through organized modules and centralized state management.
- Central AppState struct coordinates shared pasta data across all endpoints
- Endpoints are grouped by functionality (admin, auth, create, etc.)
- Clear distinction between frontend templates and backend logic handling
Tech Stack
Built primarily with Rust, the project leverages modern systems programming for performance and safety while integrating essential web and utility libraries.
- Primary language: Rust with Actix Web for web server capabilities
- Configuration managed via clap and lazy_static for environment variables
- Template rendering powered by Askama HTML templates
- Data persistence supported through JSON or SQLite backends
Code Quality
The codebase maintains a moderate level of quality with consistent Rust idioms and structural organization, although some areas show opportunities for improvement in testing and error handling.
- Limited test coverage with no dedicated test files or formal testing practices
- Inconsistent error handling patterns and reliance on global statics for configuration
- Good use of Rust’s type system and error propagation, but some code repetition in endpoint handlers
- Moderate separation of concerns with some tight coupling between modules
What Makes It Unique
MicroBin distinguishes itself through its flexible configuration, encryption options, and admin-friendly features tailored for self-hosted deployment.
- Supports both JSON and SQLite database backends for adaptable data persistence
- Built-in client-side encryption with optional server-side encryption support
- Comprehensive admin interface offering real-time statistics and update checks
- Extensible configuration system enabling runtime customization via environment variables