How to Install PrivateBin on Linux Mint Latest

PrivateBin is a free and open-source online paste service that allows users to securely store and share sensitive information. It is written in PHP, and the source code for it is available on GitHub. In this tutorial, we will show you how to install PrivateBin on Linux Mint Latest.

Prerequisites

Before you begin with the installation, ensure that the following prerequisites are met:

Step 1: Install Dependencies

To install the necessary dependencies, open your terminal and run the following commands:

sudo apt-get update
sudo apt-get install git curl zip unzip php php-fpm php-mbstring php-curl php-json supervisor

Step 2: Download PrivateBin

Clone the PrivateBin repository from GitHub to your system using the following command:

git clone https://github.com/PrivateBin/PrivateBin.git /var/www/html/privatebin

Step 3: Configure the Web Server

For Apache, create a new VirtualHost configuration file /etc/apache2/sites-available/privatebin.conf.

<VirtualHost *:80>
    ServerName privatebin.example.com
    DocumentRoot /var/www/html/privatebin

    <Directory "/var/www/html/privatebin">
        Options FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/privatebin_error.log
    CustomLog ${APACHE_LOG_DIR}/privatebin_access.log combined
</VirtualHost>

Enable the new configuration file and restart the Apache service.

sudo a2ensite privatebin.conf
sudo systemctl restart apache2

For Nginx, create a new configuration file /etc/nginx/sites-available/privatebin.

server {
    listen       80;
    server_name  privatebin.example.com;
    root         /var/www/html/privatebin;

    index index.php;

    error_log /var/log/nginx/privatebin_error.log;
    access_log /var/log/nginx/privatebin_access.log;

    client_max_body_size 100M;

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

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
    }
}

Enable the new configuration file and restart the Nginx service.

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

For Lighttpd, create a new configuration file /etc/lighttpd/privatebin.conf.

$HTTP["host"] == "privatebin.example.com" {
    server.document-root = "/var/www/html/privatebin/"
    url.rewrite-once = (
        "^/(.*)$" => "/index.php/$1"
    )
    server.errorlog = "/var/log/lighttpd/privatebin_error.log"
    accesslog.filename = "/var/log/lighttpd/privatebin_access.log"

    $HTTP["url"] =~ "\.php" {
        fastcgi.server = (
            ".php" => (
                (
                    "socket" => "/run/php/php7.2-fpm.sock",
                    "bin-path" => "/usr/bin/php-cgi",
                    "max-procs" => 4,
                    "broken-scriptfilename" => "enable",
                )
            )
        )
    }
}

Enable the configuration file and restart the Lighttpd service.

sudo lighty-enable-mod privatebin
sudo systemctl restart lighttpd

Step 4: Configure PrivateBin

Copy the sample configuration file to a new file named config.php.

cp /var/www/html/privatebin/cfg/conf.sample.php /var/www/html/privatebin/cfg/conf.php

Then, edit the config.php file and change the necessary parameters.

sudo nano /var/www/html/privatebin/cfg/conf.php

Step 5: Test PrivateBin

Open your preferred web browser and enter the URL http://privatebin.example.com (replace privatebin.example.com with your server's domain name or IP address). The PrivateBin homepage should be displayed.

Conclusion

In this tutorial, we have shown you how to install and configure PrivateBin on your Linux Mint Latest system. PrivateBin is an excellent tool for securely storing and sharing sensitive information, and we hope that this tutorial has been helpful in getting you started.

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!