Skip to content

PrivateBin

Get your FREE "elfhosted" PrivateBin instance for demo / trial 🥳

Want to see a live demo, or "kick the tyres" 🚙 before you commit to self-hosting PrivateBin?

Try out an "ElfHosted" 🧝 instance of PrivateBin for FREE!

PrivateBin is a minimalist, open source online pastebin where the server (can) has zero knowledge of pasted data. We all need to paste data / log files somewhere when it doesn't make sense to paste it inline. With PrivateBin, you can own the hosting, access, and eventual deletion of this data.

PrivateBin Screenshot

PrivateBin Requirements

Ingredients

Already deployed:

Related:

Preparation

Setup data locations

We'll need a single location to bind-mount into our container, so create /var/data/privatebin, and make it world-writable (there might be a more secure way to do this!)

mkdir /var/data/privatebin
chmod 777 /var/data/privatebin/

PrivateBin Docker Swarm config

Create a docker swarm config file in docker-compose syntax (v3), something like the example below:

Fast-track with premix! 🚀

I automatically and instantly share (with my sponsors) a private "premix" git repository, which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a git pull and a docker stack deploy 👍.

🚀 Update: Premix now includes an ansible playbook, so that sponsors can deploy an entire stack + recipes, with a single ansible command! (more here)

version: '3'

services:
  app:
    image: privatebin/nginx-fpm-alpine
    volumes:
      - /var/data/privatebin:/srv/data
    networks:
      - traefik_public
    deploy:
      labels:
        # traefik common
        - traefik.enable=true
        - traefik.docker.network=traefik_public

        # traefikv1
        - traefik.frontend.rule=Host:privatebin.example.com
        - traefik.port=4180     

        # traefikv2
        - "traefik.http.routers.privatebin.rule=Host(`privatebin.example.com`)"
        - "traefik.http.services.privatebin.loadbalancer.server.port=4180"
        - "traefik.enable=true"

networks:
  traefik_public:
    external: true

Serving

Launch PrivateBin stack

Launch the PrivateBin stack by running docker stack deploy privatebin -c <path -to-docker-compose.yml>

Log into your new instance at https://YOUR-FQDN, with user "root" and the password you specified in gitlab.env.

Chef's notes 📓


  1. The PrivateBin repo explains how to tweak configuration options, or to use a database instead of file storage, if your volume justifies it :) 

  2. The inclusion of Privatebin was due to the efforts of @gkoerk in our Discord server- Unfortunately on the 22nd August 2020 Jerry passed away. Jerry was very passionate and highly regarded in the field of Information Technology. He will be missed. 

Tip your waiter (sponsor) 👏

Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! 👏

Employ your chef (engage) 🤝

Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.

Learn more about working with me here.

Flirt with waiter (subscribe) 💌

Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.

Your comments? 💬