MicroBin: Self-Hosted Pastebin for Simplifying Sharing
MicroBin, the self-hosted pastebin that simplifies sharing long texts, large files, and sensitive documents securely. It's also a URL shortener and secure upload host.
![MicroBin: Self-Hosted Pastebin for Simplifying Sharing](/content/images/size/w1200/2023/10/microbin-self-hosted-main1-noted.lol.png)
A self-hosted pastebin can be useful for many different purposes. It serves as a platform for effortlessly sharing text based information, such as code snippets, draft documents, or crucial notes. In this article, we'll take a look at MicroBin.
![](https://noted.lol/content/images/2023/10/microbin-self-hosted-main-noted.lol.png)
What is MicroBin
MicroBin is a compact yet loaded pastebin web app that you can self-host. It's simple to set up by tweaking environment variables to add or remove features. With Docker, you can have it good to go in just a couple of minutes.
MicroBin Core Features
- Entirely self-contained executable, MicroBin is a single file!
- Server-side and client-side encryption
- File uploads (e.g., server.com/file/pig-dog-cat)
- Raw text serving (e.g., server.com/raw/pig-dog-cat)
- QR code support
- URL shortening and redirection
- Animal names instead of random numbers for upload identifiers (64 animals)
- SQLite and JSON database support
- Private and public, editable and uneditable, automatically and never expiring uploads
- Automatic dark mode and custom styling support with very little CSS and only vanilla JS (see water.css)
MicroBin demo: https://pub.microbin.eu/
MicroBin is a multi-tool that can simplify various tasks. You can use it to send long texts or share large files with others. It's also a "secure" way to exchange sensitive documents. MicroBin also functions as a URL shortener and redirection service, making it easy to keep track of your links. You can even transfer files between your computer and a server accessed from the console.
One of the newer features of MicroBin available in version 2.0 is the URL shortening ability. You can simply pop a link into the content box and it will utilize the link creator as a way to shorten links. I believe they should be shorter, but it follows a naming method using three animals so for now that is out of your control.
![](https://noted.lol/content/images/2023/10/microbin-self-hosted-url-shortner-noted.lol.png)
There has been a few important updates in version 2.0 that make MicroBin way cooler than before. Included is also an admin page where you can see all the pastas and short URLs. I find the admin area looks much better if you have the MICROBIN_WIDE=true
environment variable set to true.
![](https://noted.lol/content/images/2023/10/microbin-admin-noted.lol.png)
I'd like to point out an interesting feature of MicroBin. It's not limited to text! You can also upload images or documents alongside your pastes, making it suitable for a range of content. This feature can come in handy for showcasing a bug you've encountered in an application. You can paste the error message and simultaneously include a screenshot to provide a clearer picture of the issue. Don't mind me though, I decided to be a little more creative 😁
![](https://noted.lol/content/images/2023/10/microbin-image-upload-noted.lol.png)
More Photos of MicroBin
Here's a quick photo tour of the MicroBin in action on my server.
![](https://noted.lol/content/images/2023/10/microbin-self-hosted-gallery-noted.lol--1-.png)
![](https://noted.lol/content/images/2023/10/microbin-self-hosted-gallery-noted.lol--2-.png)
![](https://noted.lol/content/images/2023/10/microbin-self-hosted-gallery-noted.lol--3-.png)
![](https://noted.lol/content/images/2023/10/microbin-self-hosted-gallery-noted.lol--4-.png)
Turn device sideways for larger view or zoom.
Installing MicroBin using Docker Compose
You will need a host machine with Docker and Docker Compose installed for this example. If you need assistance, see our guide Install Docker and Portainer on Debian for Self-Hosting.
Below is the compose I crafted based on the environment variables that best suit my needs. You can see all of the available MicroBin environment variables here.
services:
paste:
image: danielszabo99/microbin
restart: always
environment:
- MICROBIN_PRIVATE=false
- MICROBIN_PUBLIC_PATH=https://your-domain.com
- MICROBIN_QR=true
- MICROBIN_HIGHLIGHTSYNTAX=true
- MICROBIN_ADMIN_USERNAME=Jeremy
- MICROBIN_ADMIN_PASSWORD=V3ryS3cret
- MICROBIN_ENCRYPTION_CLIENT_SIDE=false
- MICROBIN_ENCRYPTION_SERVER_SIDE=true
- MICROBIN_TITLE=Microbin
- MICROBIN_QR=True
- MICROBIN_HIDE_FOOTER=True
- MICROBIN_WIDE=true
ports:
- "8065:8080"
volumes:
- /docker/microbin:/my/microbin
- /docker/microbin/data:/app/pasta_data
One significant drawback I encountered with this otherwise wonderful app nearly made me reconsider reviewing it. Pastes don't persist when the container restarts. I wondered, "What's the point?" So, I dug into the issue tracker and found a issue addressing this concern. It seems the developer intends to fix this in MicroBin version 2.1.
Final Notes and Thoughts
MicroBin is well designed and does its job effectively. I believe that soon there will be an option to personalize your paste names, which will enhance the tool's functionality, especially for those who use it for URL shortening.
All-in-all, I recommend giving it a try if you don't mind losing your pastes after a container or system reboot. As I mentioned earlier, the solution for this problem is expected to come with version 2.1, but we don't have a confirmed release date yet.
The only other feature I wish MicroBin has is the ability to render MarkDown. But you can't have it all can you? That's the beauty of open-source and self-hosting, there are options and apps for just about everything!
If you find this application valuable or would like to explore further information, I encourage you to visit the MicroBin GitHub repository and give the project a star. Browse the Microbin docs to see all the features and guide.