You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Jonas Geiler 3bbd64611f fix: corrected spelling of "minimalistic" 4 weeks ago
.cargo Docker, Cargo: Add multi-arch builds for arm64, x86_64 7 months ago
.github contributing: add info in the readme, add a pr template 7 months ago
contrib/cli Showcase the demo version 7 months ago
resources Add a ton of new syntaxes 7 months ago
src Fix typo: pretter -> pretty 4 months ago
static pretty.css: add media queries to move pastes down on phones 4 months ago
templates fix: corrected spelling of "minimalistic" 4 weeks ago
tools tools/prepush: apply the formatting instead of checking it 6 months ago
.dockerignore dockerignore: add dockerignore 2 years ago
.gitignore add /p/<id> routes 2 years ago
Cargo.lock bin v2.2.1 4 months ago
Cargo.toml bin v2.2.1 4 months ago
Dockerfile Templates: fix the content type of templates 7 months ago Add cache-busting and server headers with a wrapper. 7 months ago
copying license: lgpl license 2 years ago
docker-compose.yml Templates: fix the content type of templates 7 months ago
fly.toml fly.toml: using mapped env variables is a PITA on TOML 7 months ago Index: Add option to remove /client help 4 months ago
rustfmt.toml cargo-fmt the src 7 months ago


A minimal pastebin which also accepts binary files like Images, PDFs and ships multiple clients.

It does not require you to host a SQL server and everything is self-contained in a statically linked binary (the docker image runs on scratch !), which makes it extremely easy to deploy.

Try it out on:



You can paste

  • Normal Text

  • Paste Images from clipboard:

  • Files by drag and drop:




Get the client from this repository or from my deployed paste:

curl -o pst
chmod +x pst

or manually copy the following at a file in your path.


# Change the url accordingly

FILENAME=$(basename -- "$FILEPATH")

RESPONSE=$(curl --data-binary @${FILEPATH:-/dev/stdin} --url $URL)

[ -z "$EXTENSION" ] && \
    echo "$PASTELINK" || \

You have the option to remove the /client description / help in the landing page. To show the /client description, run the bin binary with either BIN_CLIENT_DESC env variable or a -c flag. More on arguments later


It just works.

$ pst somefile.txt
$ cat someimage.png | pst



  1. Install the CLI client
  2. Append this to your init.vim / vimrc
nnoremap <leader>p :!pst %<CR>


Use <leader> + p paste.

Server Deployment

Currently, builds for the following target triples are shipped:

  • x86_64-unknown-linux-gnu (amd64)
  • aarch64-unknown-linux-gnu (arm64)

The builds shipped are statically linked, so you don't even need a libc to run the binary !
The docker manifest labelled wantguns/bin:latest includes the images for both amd64 and arm64 images.


$ docker run -p 6162:6162 wantguns/bin

Docker Compose

version: '3.3'
    image: wantguns/bin
    container_name: pastebin
      - BIN_PORT=6163 # Defaults to 6162
      - BIN_LIMITS={form="16 MiB"}
      - BIN_CLIENT_DESC=placeholder
      - ./upload:/upload  # upload folder will have your pastes


  • Grab a copy of the binary from GH releases
  • Build on your own:
# A statically linked build
$ cargo build --release
  • Execute the binary as is, no extra shenanigans needed:
$ ./bin


    bin [OPTIONS]

    -a, --address <ADDRESS>
            Address on which the webserver runs [default:]

    -b, --binary-upload-limit <BINARY_UPLOAD_LIMIT>
            Binary uploads file size limit (in MiB) [default: 100]

    -c, --client-desc
            Include client description [env: CLIENT_DESC=]

    -h, --help
            Print help information

    -p, --port <PORT>
            Port on which the webserver runs [default: 6162]

    -u, --upload <UPLOAD>
            Path to the uploads folder [default: ./upload]

    -V, --version
            Print version information


This pastebin utilizes a custom configuration provider from Rocket. Apart from the essential arguments, you can also use environment variables, which have the highest preference in order.

Everything from the official Rocket doc is supported, just that you have to prefix the env variable with "BIN_":

BIN_LIMITS={form="16 MiB"}


GET /<id>
Get raw pastes

GET /p/<id>
Get highlighted pastes

GET /p/<id>.<ext>

Get syntax highlighted pastes.
E.g. should return a C++ syntax highlighted paste

Post binary data

Design Decisions

This pastebin:

  • does not use a database. It lacks non-essential features like password-protection / automatic deletion as a result of which, it can do completely fine with flat filesystems. As an upside (opinionated), it makes deploying it easier.
  • uses server sided highlighting, which ensures that everything stays light and snappy at the client side.
  • uses very minimal frontend because a pastebin does not need it. It focuses (or atleast tries to) on getting things done in minimum amount of clicks.


  • If you want to ensure your pushed refs will pass CI, add the prepush script to your Git hooks:

    $ cp -a tools/prepush .git/hooks/pre-push

    Alternately, just run ./tools/prepush yourself before pushing.

  • The Cargo configuration for this project is set for statically compiled builds. You can check out the config file to know more.

  • Read the buildci to know how the project is statically compiled for two architectures.