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!

If you found an issue in this article, you can create an issue on Github.

If you have a comment or question, please drop me a line below!