Introduction

A minimal pastebin application designed to handle various file types, including binary files like images and PDFs. It provides multiple client options and operates entirely as a self-contained, statically linked binary—no need for a SQL server. With a lightweight Docker image built on scratch, deployment is incredibly simple and efficient.

Step 1: Install Required Packages

Before installing wantguns/bin, ensure the necessary packages are installed on your server. Use the following commands to install them:

  • For Debian/Ubuntu based distributions:
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin curl
  • For Arch Linux based distributions:
sudo pacman -Syu
sudo pacman -S docker docker-compose curl

Then enable the service:

sudo systemctl enable docker.service

Step 2: Installing wantguts/bin

First, create a folder named bin in your desired location and navigate into it. Create a file named docker-compose.yml and add the following content:

mkdir -p path/to/location
vim path/to/location/docker-compose.yml

docker-compose.yml file:

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

Then run this command to run it:

docker compose up -d

Step 3: Use Zero Trust Tunells

Go to this site: one.dash.cloudflare.com, then navigate to the Networks section and click on Tunnels.

Then create a new Tunnel:

image

Select Cloudflared:

image

Name your tunnel:

image

Then install and run a connector:

image

Then do it:

image

Conclusion

Congratulations! You have successfully installed and ran pastebin on your server. You are now ready to use your self hosted pastebin service.