LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

Set Up Your Own Private Pastebin: Control Your Snippets and Secrets

PrivateBinIf you’ve ever relied on public pastebin services to share code snippets, logs, or sensitive configurations, you’ve probably worried about privacy and longevity. Public pastebins can delete content at any time, expose data to unwanted eyes, or fail to give you fine-grained control over who sees what.  And what if they get hacked?  Even if you’re anonymous, logs and other data could possibly trace things back to you.  And if you’re stored anything sensitive there, they could be exposed.

The good news is that you can easily set up your own self-hosted Pastebin.  That’s the LowEnd DIY way!

Advantages of Your Own Self-Hosted Pastebin

  • Security & Privacy: Your data stays in your environment, not a third-party service.

  • Customization: Add custom themes, logos, etc.

  • Longevity: Decide how long pastes live and what happens when they expire.

  • Integration: Tie it into internal systems, like issue trackers, or use it for logging and debugging.  You control the backend so it’s easy to script things.

Choose a Self-Hosted Pastebin Project

There are several open-source pastebin projects available. A few popular ones include PrivateBin, Hastebin, and Pastey.  For this guide, we’ll use PrivateBin because it only requires PHP and a web server.

Don’t feel like running your own server but still want your own PasteBin?  Check out PikaPods where you can run a PrivateBin for only $1.20/month.

Step-by-Step Setup

Get a Low-Cost VPS

A basic VPS from providers featured on LowEndBox is more than enough.  In this example I’ll use a spare 1GB/1 core VPS I have.  You don’t need to dedicate an entire VPS to this, of course.  I’ll use Debian 12 and my site is paste.lowend.party.

Install Dependencies

apt update && apt install -y nginx php-fpm unzip

Download and Configure PrivateBin

cd /var/www
wget https://github.com/PrivateBin/PrivateBin/archive/refs/tags/1.7.3.zip -O privatebin.zip
unzip privatebin.zip
mv PrivateBin-1.7.3 privatebin
chown -R www-data:www-data privatebin

Set Up Nginx

Create a new site config in /etc/nginx/sites-available/paste.lowend.party:

server {
    listen 80;
    server_name paste.lowend.party;

    root /var/www/privatebin;
    index index.php;

    location / {
        try_files $uri /index.php;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
    }
}

Enable the site and reload:

ln -s /etc/nginx/sites-available/paste.lowend.party /etc/nginx/sites-enabled/
systemctl restart nginx

Secure with SSL

Use Let’s Encrypt for free HTTPS:

apt install certbot python3-certbot-nginx
certbot --nginx -d paste.lowend.party

Success!

Here’s what it looks like:

PrivateBin

If you look at the top, you can see some of PrivateBin’s cool features:

  • Password-Protect Pastes: PrivateBin supports optional passwords.

  • Expire Pastes: Configure default expiration times in cfg/conf.php.

  • Burn After Reading: SnapChat for your pastes

  • Formats: supports plain text, source code, and Markdown

Related Posts:

No Comments

    Leave a Reply

    Some notes on commenting on LowEndBox:

    • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
    • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
    • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

    Your email address will not be published. Required fields are marked *