How to Install PrivateBin on Arch Linux

PrivateBin is a self-hosted tool that allows users to store and share text, images, and other files securely online. In this tutorial, we will guide you through the process of installing PrivateBin on Arch Linux.

Prerequisites

Before you begin, ensure that you have:

Step 1: Install required packages

First, you need to install the Pacman package manager to manage packages in Arch Linux. To do so, run the following command in your terminal:

sudo pacman -Syu

Once the update process is completed, install the required packages for PrivateBin:

sudo pacman -S apache php php-apache php-mcrypt php-intl php-gd mcrypt

Step 2: Configure Apache

Now, we need to configure Apache to support PHP. To do so, open the Apache configuration file using your favourite text editor:

sudo nano /etc/httpd/conf/httpd.conf 

Scroll down to the section and add the following lines:

LoadModule php7_module modules/libphp7.so
AddHandler php7-script php 
Include conf/extra/php7_module.conf

Once you've added these lines, save and close the file.

Restart Apache for the changes to take effect:

sudo systemctl restart httpd

Step 3: Download PrivateBin

Download the latest version of PrivateBin using the following command:

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

After cloning, change the ownership of the directory using the following command:

sudo chown -R http:http /var/www/html

Step 4: Configure PrivateBin

Create a new configuration file for PrivateBin by copying the example file:

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

Edit the configuration file using your favourite text editor:

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

Configure the following lines, replacing PRIVATEBIN_DOMAIN.COM with your own domain name or public IP address:

$c['baseurl'] = 'https://PRIVATEBIN_DOMAIN.COM/';
$c['datadir'] = '/var/www/html/data';

Save and close the file.

Step 5: Create a Data Directory

Create a new directory to store your PrivateBin data:

sudo mkdir /var/www/html/data

Set the appropriate permissions for the directory:

sudo chown -R http:http /var/www/html/data
sudo chmod -R 700 /var/www/html/data

Step 6: Adjust firewall settings

If you're using the Arch Linux firewall (ufw), you need to allow traffic on port 80 (HTTP) and port 443 (HTTPS):

sudo ufw allow http
sudo ufw allow https

Step 7: Test PrivateBin

Open your web browser and navigate to https://PRIVATEBIN_DOMAIN.COM/. If everything has been configured correctly, you should see the PrivateBin homepage.

Conclusion

You've successfully installed PrivateBin on Arch Linux! You can now use this secure and self-hosted tool to store and share text, images, and other files with others.

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!