Overview
Discover what makes bin powerful
`bin` is a minimal, self‑hosted paste service written entirely in Rust. The core idea is to deliver a **single executable** that can be dropped into any environment and started with zero external dependencies. Once running, it exposes a tiny HTTP API that accepts `PUT` requests for new pastes and serves them via simple GET URLs. The application keeps a rotating in‑memory buffer of the most recent pastes, discarding older entries automatically. This design eliminates the need for a database or persistent storage while still offering fast, low‑latency responses.
Zero‑dependency runtime
In‑memory rotation buffer
HTTP API
Lightweight syntax highlighting
Overview
bin is a minimal, self‑hosted paste service written entirely in Rust. The core idea is to deliver a single executable that can be dropped into any environment and started with zero external dependencies. Once running, it exposes a tiny HTTP API that accepts PUT requests for new pastes and serves them via simple GET URLs. The application keeps a rotating in‑memory buffer of the most recent pastes, discarding older entries automatically. This design eliminates the need for a database or persistent storage while still offering fast, low‑latency responses.
Key Features
- Zero‑dependency runtime – a single binary, no database, no external services.
- In‑memory rotation buffer – configurable size (
--buffer-size) and paste limit (--max-paste-size). - HTTP API –
PUTto create,GETto retrieve; supports optional file‑extension query for syntax highlighting. - Lightweight syntax highlighting – uses the
syntectcrate to render code blocks based on file extensions. - Cross‑platform – compiled Rust binaries work on Linux, macOS, Windows; container images are also available.
- Extremely small footprint – ~300 lines of Rust, < 10 MB binary.
Technical Stack
| Layer | Technology |
|---|---|
| Language | Rust 1.70+ (stable) |
| Web framework | hyper + tokio for async I/O |
| Routing / handling | Minimal custom router; no heavy framework overhead |
| Syntax highlighting | syntect crate, bundled with a small set of language grammars |
| Storage | In‑memory VecDeque with configurable capacity; no persistence layer |
| Configuration | Command‑line flags (--buffer-size, --max-paste-size) parsed with clap |
| Deployment | Single static binary; optional Docker image (ghcr.io/w4/bin) |
Core Capabilities & APIs
- Create a paste
Returns a short, unique URL (e.g.,curl -X PUT --data-binary @file.txt http://localhost:8820//a1b2c3). - Retrieve a paste – simple GET to the returned URL.
- Syntax highlighting – append the file extension (e.g.,
/a1b2c3.rs) to triggersyntect. - Health & metrics – no built‑in monitoring, but the lightweight nature allows easy integration with Prometheus or custom metrics via HTTP endpoints.
Deployment & Infrastructure
- Self‑hosting – Run
./binor the Docker container; no privileged operations required. - Scalability – The in‑memory buffer limits memory usage; for higher throughput, run multiple instances behind a load balancer.
- Containerization – Official Docker images are available; the binary is statically linked, so the image size stays below 30 MB.
- Resource profile – CPU: <10 % on a single core; Memory: ~1 MB per 1000 pastes (configurable).
Integration & Extensibility
While bin is intentionally minimal, its API makes it easy to embed into larger workflows:
- CI/CD pipelines – Store build logs or test outputs temporarily.
- Developer tools – Plug into IDEs to share snippets via the
PUTendpoint. - Webhooks – Trigger paste creation from external services (e.g., GitHub Actions).
- Custom front‑ends – The server only serves raw text; any UI can be built on top (e.g., a Vue or React app that consumes the API).
No plugin system is shipped, but the small codebase invites contributors to add features such as authentication or persistence.
Developer Experience
- Configuration – All options are exposed via command‑line flags; no configuration files.
- Documentation – The README is concise but covers usage, API examples, and build instructions.
- Community – The project is hosted on GitHub with an active issue tracker; contributions are welcomed.
- Licensing – MIT license, allowing unrestricted use in commercial or internal projects.
Use Cases
| Scenario | Why bin fits |
|---|---|
| Rapid code sharing | Instant paste URLs via curl; no registration required. |
| CI artifact storage | Store logs or test results for a few minutes without persisting on disk. |
| Internal tooling | Embed into custom dashboards or chatbots to share snippets on demand. |
| Educational environments | Provide a simple, self‑hosted paste service for classrooms or hackathons. |
Advantages Over Alternatives
| Criterion | bin | Typical Paste Services |
|---|---|---|
| Performance | Single‑threaded async, <10 % CPU | Often heavier frameworks |
| Footprint | < 10 MB binary, no DB | Larger images, external storage |
| Simplicity | 300 lines of Rust, no config files | Multiple moving parts |
| Licensing | MIT | GPL or proprietary |
| Extensibility | Customizable via code, API hooks | Closed ecosystems |
For developers who need a quick, reliable, and fully controllable paste service without the overhead of database migrations or third‑party integrations, bin offers an elegant
Open SourceReady to get started?
Join the community and start self-hosting bin today
Related Apps in other
Immich
Self‑hosted photo and video manager
Syncthing
Peer‑to‑peer file sync, no central server
Strapi
Open-source headless CMS for modern developers
reveal.js
Create stunning web‑based presentations with HTML, CSS and JavaScript
Stirling-PDF
Local web PDF editor with split, merge, convert and more
MinIO
Fast, S3-compatible object storage for AI and analytics
Weekly Views
Repository Health
Information
Explore More Apps
What to Cook?
Suggest recipes based on your pantry
EGroupware
Open source online office for secure, sovereign collaboration
Calibre-Web
Web‑based eBook library manager and reader
Reactive Resume
Build and share resumes in seconds, privately
MyIP
All‑in‑one IP and network diagnostics tool
Databunker
Secure PII/PCI tokenization in 10 minutes