An easy Pastebin-like service with a command line client

Let me introduce you to Hastebin.

It is a simple pastebin service that you can self-host.


The server bits are available at

I personally use this Docker container:


The awesome part is that you can paste from the command line!

You have two choices: using gem or a simple bash alias that doesn’t require you to install anything (besides curl).

Using Gem

gem install haste

Create an alias in your .bashrc or .zshrc config:

alias pastebin="HASTE_SERVER= haste"

Restarting your session or source your config file.

Client sources

Using a bash alias

pastebin() { a=$(cat); curl -X POST -s -d "$a" | awk -F '"' '{print ""$4}'; }


echo blah | pastebin

Thanks for reading this post!

Did you find an issue in this article?

- click on the following Github link
- log into Github with your account
- click on the line number containing the error
- click on the "..." button
- choose "Reference in new issue"
- add a title and your comment
- click "Submit new issue"

Your feedback is much appreciated! πŸ€œπŸΌπŸ€›πŸΌ

You can also drop me a line below!