Sharing code snippets, error logs, and configuration files is a daily routine for developers and system administrators. Public pastebin services like Pastebin.com have existed for decades, but they come with serious limitations: your data lives on someone else’s server, there are no guarantees about deletion, and sensitive information like API keys or stack traces can be indexed, scraped, or exposed in data breaches.
A self-hosted pastebin solves all of these problems. You control where the data lives, how long it persists, and who can access it. For teams working on proprietary code, handling incident response logs, or sharing credentials during migrations, a self-hosted paste server is not a luxury — it is a practical necessity.
Why Self-Host a Pastebin?
The case for running your own paste service is stronger than ever in 2026. Here is why organizations and individual developers are making the switch:
Data sovereignty. When you paste a stack trace containing database connection strings, or share a configuration file with internal endpoints, that data should not leave your infrastructure. Self-hosting ensures zero third-party exposure.
Automatic expiration with real enforcement. Public pastebins claim to support expiring links, but the data often persists on backup tapes and caches indefinitely. On your own server, expiration is enforced at the file level — when a paste expires, it is physically deleted.
Private sharing within teams. Need to share a one-time password, a migration script, or a debug log with a colleague? A self-hosted pastebin gives you internal URLs that are only accessible from your network or behind your authentication layer.
No rate limits or ads. Public services throttle heavy users and display advertisements. Your own instance has no artificial limits and no tracking scripts.
Compliance requirements. Industries subject to GDPR, HIPAA, or SOC 2 regulations cannot legally paste production logs or personally identifiable information on public platforms. Self-hosting keeps you within compliance boundaries.
Zero dependency risk. Public pastebins shut down, change their terms of service, or go behind paywalls without notice. Your own instance stays available as long as your server is running.
Top Self-Hosted Pastebin Solutions
Three open-source pastebin applications stand out in 2026, each targeting a different use case. Understanding their differences will help you pick the right tool for your environment.
PrivateBin — The Privacy-First Champion
PrivateBin is the most feature-complete self-hosted pastebin available. Its defining characteristic is zero-knowledge encryption: all encryption and decryption happens in the browser using JavaScript. The server never sees the plaintext content of any paste. Even if someone compromises the server, they only see encrypted blobs.
PrivateBin supports password-protected pastes, burn-after-reading mode, syntax highlighting for over 200 programming languages, file attachments, discussion threads on pastes, and fine-grained expiration controls. It stores data in flat files by default but also supports MySQL, MariaDB, PostgreSQL, SQLite, Google Cloud Storage, and Amazon S3 as backends.
The project has been actively maintained since 2013 and has a large community. It is the default choice for anyone who takes privacy seriously.
MicroBin — The Minimalist Alternative
MicroBin is a newer entrant designed around simplicity. Written in Rust, it is distributed as a single static binary with no external dependencies beyond a SQLite database. The entire application is contained in one file, making deployment and upgrades trivial.
MicroBin offers paste creation with expiration, syntax highlighting, a clean modern interface, and an optional read-only API. It does not have client-side encryption, but it is significantly easier to deploy than PrivateBin and consumes far fewer resources.
The project is ideal for homelab users, small teams, or anyone who wants a “set it and forget it” paste server without managing PHP runtimes or web servers.
Hastypaste — The Speed-Oriented Option
Hastypaste is a lightweight paste server built in Python with a focus on speed and simplicity. It provides a minimal web interface, a straightforward REST API, and supports automatic paste expiration. It is designed to be the spiritual successor to services like hastebin.com but self-hosted.
Hastypaste is the simplest of the three options to understand and modify. If you want a paste server that you can customize, extend, or integrate into existing Python-based infrastructure, this is the platform to start with.
Feature Comparison
| Feature | PrivateBin | MicroBin | Hastypaste |
|---|---|---|---|
| Language | PHP | Rust | Python |
| Client-side encryption | Yes | No | No |
| Password-protected pastes | Yes | No | No |
| Burn-after-reading | Yes | No | No |
| File attachments | Yes | No | No |
| Syntax highlighting | 200+ languages | Yes | Yes |
| Discussion threads | Yes | No | No |
| REST API | Limited | Yes | Yes |
| Database support | Flat files, MySQL, PostgreSQL, SQLite, S3, GCS | SQLite | SQLite |
| docker image | Official | Official | Community |
| Binary size | ~5 MB | ~8 MB single binary | ~50 MB with deps |
| RAM usage | ~50 MB | ~10 MB | ~30 MB |
| Active development | Yes | Yes | Yes |
| License | zlib | MIT | MIT |
Deploying PrivateBin with Docker
PrivateBin is the recommended choice for most users. Here is a complete deployment guide.
Basic Docker Compose Setup
Create a directory for your PrivateBin installation:
| |
Create the docker-compose.yml file:
| |
Start the service:
| |
Access PrivateBin at http://localhost:8080. The default configuration works out of the box with flat-file storage.
Hardening PrivateBin for Production
The default configuration is functional but not hardened. Create a custom cfg/conf.php for production use:
| |
Restart to apply:
| |
Key production changes: disabled public discussions, enabled password protection by default, set a dark theme, capped paste size at 10 MB, limited maximum expiration to one month, and added a strict Content Security Policy header.
Adding Nginx Reverse Proxy with TLS
For production access, place PrivateBin behind Nginx with Let’s Encrypt TLS:
| |
PostgreSQL Backend for High-Traffic Deployments
If you expect more than a few hundred pastes per day, switch from flat files to PostgreSQL:
| |
Update conf.php to use the database backend:
| |
Deploying MicroBin with Docker
MicroBin is ideal when you want the simplest possible setup. The entire application is a single binary.
Docker Compose
| |
Start it:
| |
That is the entire configuration. MicroBin handles everything internally — no separate web server, no PHP runtime, no database configuration. The SQLite database is created automatically in the uploads directory.
Running as a Systemd Service (No Docker)
If you prefer not to use Docker, MicroBin can run as a native systemd service:
| |
Create the systemd unit:
| |
Then enable and start:
| |
Deploying Hastypaste
Hastypaste offers a middle ground with its Python-based architecture and clean API.
Docker Compose
| |
Start the service:
| |
Hastypaste exposes a simple REST API for programmatic paste creation:
| |
Integrating Pastebin into Your Workflow
A self-hosted pastebin becomes genuinely useful when integrated into your daily tools. Here are practical integration patterns.
CLI Shortcut for Quick Pastes
Add a shell function to ~/.bashrc or ~/.zshrc for sending files to your PrivateBin instance:
| |
Vim Integration
Add this to your ~/.vimrc to send the current buffer to your paste server:
| |
VS Code Integration
Several extensions support custom pastebin backends. Install “Paste Image” or “Clipboard to URL” and configure the endpoint to point to your MicroBin or Hastypaste API. For PrivateBin, the CLI approach via shell task integration works well:
| |
CI/CD Integration
Include paste creation in your CI pipeline for sharing build artifacts, test logs, or deployment reports:
| |
Security Best Practices
Running a pastebin on your infrastructure introduces security considerations that are worth addressing proactively.
Rate limiting. Public-facing paste servers attract abuse. Add rate limiting to your reverse proxy:
| |
Content scanning. Consider running uploaded content through a malware scanner if you allow file attachments. ClamAV integrates well via a cron job that scans the paste data directory:
| |
Network segmentation. For internal team use, restrict access to your LAN or VPN. With Docker, bind to localhost only and let Nginx handle external access with authentication:
| |
Regular backups. Even with auto-expiration, back up your paste data directory. With PrivateBin, this is a simple rsync:
| |
Disable external paste submission. If the pastebin is strictly internal, add HTTP basic authentication or restrict by IP range in your Nginx configuration:
| |
Which Solution Should You Choose?
The decision comes down to your specific requirements:
Choose PrivateBin if privacy is your top priority. Client-side encryption means the server operator (even you) cannot read paste contents. This is critical for regulated industries or when sharing sensitive credentials. It is also the best choice if you need file attachments, discussion threads, or enterprise-grade database backends.
Choose MicroBin if you value simplicity and low resource usage. A single binary with no dependencies, minimal RAM footprint, and a clean interface make it ideal for homelab deployments, Raspberry Pi instances, or small teams that need a reliable paste server without complexity.
Choose Hastypaste if you need a programmable API and Python-based extensibility. It is the easiest to customize and integrate into existing Python workflows. The straightforward REST API makes it a natural fit for automated pipelines and tooling.
All three solutions can be running on a $5 VPS or a Raspberry Pi with less than 100 MB of RAM. The barrier to self-hosting a pastebin has never been lower, and the privacy and control benefits make it one of the most practical self-hosted services you can deploy today.
Frequently Asked Questions (FAQ)
Which one should I choose in 2026?
The best choice depends on your specific requirements:
- For beginners: Start with the simplest option that covers your core use case
- For production: Choose the solution with the most active community and documentation
- For teams: Look for collaboration features and user management
- For privacy: Prefer fully open-source, self-hosted options with no telemetry
Refer to the comparison table above for detailed feature breakdowns.
Can I migrate between these tools?
Most tools support data import/export. Always:
- Backup your current data
- Test the migration on a staging environment
- Check official migration guides in the documentation
Are there free versions available?
All tools in this guide offer free, open-source editions. Some also provide paid plans with additional features, priority support, or managed hosting.
How do I get started?
- Review the comparison table to identify your requirements
- Visit the official documentation (links provided above)
- Start with a Docker Compose setup for easy testing
- Join the community forums for troubleshooting