How to Install 0bin on Debian Latest

0bin is a web-based pastebin application that encrypts and stores the data on a custom server, making it secure for sharing data like passwords, codes or any other confidential stuff. In this tutorial, we will show you how to install 0bin on Debian Latest.

Prerequisites

Step 1 - Install Required Packages

Before installing 0bin, make sure to update and upgrade the Debian system packages to the latest versions.

To do that, run the following commands in your terminal:

$ apt-get update
$ apt-get upgrade

Next, install the required packages for 0bin to work properly:

$ apt-get install php php-fpm php-mbstring php-openssl git

Step 2 - Configure Nginx

To run 0bin, we need to configure a web server. In this tutorial, we will use Nginx as our web server.

To begin, create a new server block configuration file for 0bin inside the /etc/nginx/conf.d directory with the following command:

$ nano /etc/nginx/conf.d/0bin.conf

Then, paste the following configuration code into the file:

server {
    listen 80;
    listen [::]:80;

    server_name your-domain.com;

    root /var/www/html/0bin;
    index index.php;

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

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

Don't forget to change your-domain.com with your actual domain name.

In this configuration file, we tell Nginx to listen on port 80 for incoming requests on the domain name specified in the server_name directive.

We also specify the root directory where 0bin's code will reside, and specify the index.php file which Nginx should serve when accessing the root URL.

Finally, we have specified the configuration for the PHP-FPM backend which will handle the PHP code of 0bin.

Step 3 - Download and Install 0bin

Now, it's time to install 0bin.

Navigate to the /var/www/html directory and clone the 0bin repository using git:

$ cd /var/www/html
$ git clone https://github.com/Tygs/0bin.git

Next, change the ownership of the 0bin directory to the web server user and group:

$ chown -R www-data:www-data /var/www/html/0bin

Step 4 - Configure 0bin

After installing 0bin, you need to edit the config.php file and configure settings like database settings, encryption, logging, etc.

Navigate to the 0bin directory and copy the config.php.sample file to config.php:

$ cd /var/www/html/0bin
$ cp config.php.sample config.php

Then, open the config.php file and modify settings to your specific requirements using nano or any text editor of your choice:

$ nano config.php

Here is an example of a few sample settings which need to be configured:

$config['paste_expire'] = '+1 week';
$config['cipher'] = 'rijndael-192';
$config['hash_algo'] = 'sha512';
$config['max_pastes_per_ip'] = 10;
$config['recaptcha_site_key'] = '';
$config['recaptcha_secret_key'] = '';

Step 5 - Restart and Test 0bin

After completing the configuration, it's time to restart the web server to apply the changes:

$ systemctl restart nginx
$ systemctl restart php7.4-fpm

Finally, test your 0bin installation by visiting your_domain.com in your web browser. You should see the 0bin interface.

That's it! You have successfully installed and configured 0bin on your Debian Latest machine.

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!