PrivateBin

How to Install PrivateBin on Ubuntu 24.04 Using Docker

PrivateBin is a minimalist, open-source pastebin application that encrypts data in the browser before storing it on the server. This guide walks you through installing PrivateBin manually using Docker on Ubuntu 24.04 with optional SSL support.

 

Step 1: Update Ubuntu Packages

Before installing anything, update your package lists and upgrade installed packages:

 
sudo apt update sudo apt upgrade -y sudo apt install docker.io docker-compose nginx -y

This ensures Docker, Docker Compose, and Nginx are available for running PrivateBin and managing SSL.

 

Step 2: Enable and Start Docker

Make sure Docker is enabled to start at boot and running:

 
sudo systemctl enable docker sudo systemctl start docker

Check Docker status:

 
sudo systemctl status docker

 

Step 3: Add Your User to Docker Group (Optional)

If you want to run Docker commands without sudo:

 
sudo usermod -aG docker $USER newgrp docker

 

Step 4: Configure SSL (Optional but Recommended)

If you want HTTPS for PrivateBin:

  1. Create an SSL directory:

 
sudo mkdir -p /etc/ssl/privatebin
  1. Generate a self-signed certificate:

 
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ -keyout /etc/ssl/privatebin/privatebin.key \ -out /etc/ssl/privatebin/privatebin.crt \ -subj "/CN=your-domain-or-ip"
  1. Set proper permissions:

 
sudo chmod 600 /etc/ssl/privatebin/privatebin.key

 

Step 5: Configure Nginx

Create a new Nginx site configuration for PrivateBin:

 
sudo nano /etc/nginx/sites-available/privatebin

Paste the following content:

 
server { listen 80; server_name your-domain-or-ip; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name your-domain-or-ip; ssl_certificate /etc/ssl/privatebin/privatebin.crt; ssl_certificate_key /etc/ssl/privatebin/privatebin.key; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }

Enable the site:

 
sudo ln -s /etc/nginx/sites-available/privatebin /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl restart nginx

If SSL fails, you can use the fallback HTTP configuration:

 
server { listen 80; server_name your-domain-or-ip; location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }

 

Step 6: Prepare PrivateBin Docker Directory

Create a directory for Docker Compose:

 
sudo mkdir -p /opt/privatebin

Create the Docker Compose file:

 
sudo nano /opt/privatebin/docker-compose.yml

Paste the following content:

 
version: '3' services: privatebin: image: privatebin/nginx-fpm-alpine:latest container_name: privatebin restart: unless-stopped ports: - "127.0.0.1:8080:8080" volumes: - privatebin-data:/srv/data volumes: privatebin-data:

 

Step 7: Start PrivateBin

Navigate to the Docker directory and launch PrivateBin:

 
cd /opt/privatebin sudo docker-compose up -d

Check the container status:

 
sudo docker ps --filter name=privatebin

View logs if needed:

 
sudo docker logs privatebin

 

Step 8: Access PrivateBin

 

  • If SSL is enabled:
    Open your browser at https://your-domain-or-ip

  • If only HTTP:
    Open your browser at http://your-domain-or-ip

  • 0 Usuários acharam útil
Esta resposta lhe foi útil?

Artigos Relacionados

ERPNext v15

Last Updated: 31 August 2025Applies to: Ubuntu 24.04 LTS (fresh server recommended)Skill Level:...

Open-EMR v7.0.3

Last Updated: 31 August 2025Applies to: Ubuntu 24.04 LTS (fresh server recommended)Skill Level:...

ERPNext v14

Last Updated: 31 August 2025Applies to: Ubuntu 24.04 LTS (fresh server recommended)Skill Level:...

WordPress

1. Overview WordPress is the most popular open-source blogging system and CMS on the Web. It...

Joomla

How to Install Joomla on Ubuntu 24.04   Joomla is a free and open-source content management...