How to Install PrivateBin on POP! OS

PrivateBin is a privacy-focused open-source self-hosted platform for secure sharing of sensitive data. It is written in PHP and stores data in a client-side encrypted format. In this tutorial, we will learn to install PrivateBin on POP! OS Latest.

Prerequisites

Step 1: Install Apache2 webserver

The first step is to set up a web server to host PrivateBin. We choose Apache2 as it is a popular open-source web server.

To install Apache2 on your POP! OS system, run the following command in the terminal:

sudo apt-get update
sudo apt-get install apache2

After installing Apache2, start the server with:

sudo systemctl start apache2

You can verify the installation by typing your system's IP address on the Web Browser. You should see the Apache2 Ubuntu Default page.

Step 2: Install PHP

PrivateBin is written in PHP, so you need to install PHP on your system. The PHP version supported in PrivateBin is PHP 7.1 or later. In our case, POP! OS has PHP 7.4.x and supports the latest version too.

Run the following command in the terminal to install PHP:

sudo apt-get install php libapache2-mod-php php-mysql

To verify PHP installation, create a test PHP script:

sudo vim /var/www/html/info.php

Add the following text to info.php:

<?php
phpinfo();
?>

Save the file and open it on your web browser. You should see the PHP info page.

Step 3: Download PrivateBin

Now, download PrivateBin with the following command:

sudo wget https://github.com/PrivateBin/PrivateBin/archive/master.zip

Extract the downloaded file with the following command:

sudo unzip master.zip -d /var/www/html/

Then, move the extracted files from the PrivateBin-master directory to the root directory using:

sudo mv /var/www/html/PrivateBin-master/* /var/www/html/

Now change the permission:

sudo chmod -R 775 /var/www/html/

Step 4: PrivateBin Configuration

PrivateBin configuration requires edit to the file “config.sample.php”. Rename the file with:

cp /var/www/html/config.sample.php /var/www/html/config.php

Then, open the file “config.php” with any text editors like Nano, Vim or Gedit:

sudo vim /var/www/html/config.php

Set the options as per your need:

/* Site name */
$config['sitename'] = 'My PrivateBin installation';

/* Random string used for cookies and other things */
$config['secret'] = 'skjkeuewucsdbqouqwwebjkhg';

/* Minify the HTML code */
$config['minifyhtml'] = true;

/* Expiration time for pastes (in seconds) */
$config['expire'] = 60 * 60 * 24 * 30;

Save and close the file after the configurations.

Step 5: Restart Apache2 server

After configuring the PrivateBin on Apache server, restart the server with the following command to apply the changes:

sudo systemctl restart apache2

Step 6: Testing PrivateBin

Finally, you can test your PrivateBin installation by navigating to your system's IP address on the web browser. You should see the PrivateBin page.

Enter your desired text or paste, set the other options as required, and click "Submit" to generate a URL link. You can then share the link with your trusted audience.

Congratulations! You have successfully installed PrivateBin on POP! OS.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!