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:
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:
Check Docker status:
Step 3: Add Your User to Docker Group (Optional)
If you want to run Docker commands without sudo
:
Step 4: Configure SSL (Optional but Recommended)
If you want HTTPS for PrivateBin:
-
Create an SSL directory:
-
Generate a self-signed certificate:
-
Set proper permissions:
Step 5: Configure Nginx
Create a new Nginx site configuration for PrivateBin:
Paste the following content:
Enable the site:
If SSL fails, you can use the fallback HTTP configuration:
Step 6: Prepare PrivateBin Docker Directory
Create a directory for Docker Compose:
Create the Docker Compose file:
Paste the following content:
Step 7: Start PrivateBin
Navigate to the Docker directory and launch PrivateBin:
Check the container status:
View logs if needed:
Step 8: Access PrivateBin
-
If SSL is enabled:
Open your browser athttps://your-domain-or-ip
-
If only HTTP:
Open your browser athttp://your-domain-or-ip