How to Install PurritoBin on POP! OS Latest

PurritoBin is a self-hosted pastebin alternative that allows you to store and share snippets of text or code. In this tutorial, we will walk you through the steps to install PurritoBin on POP! OS latest using the terminal.

Prerequisites

Before installing PurritoBin, you should ensure that you have the following:

Step 1: Install Required Dependencies

Start by updating your system and installing the required dependencies:

sudo apt update && sudo apt upgrade

sudo apt install -y git nginx curl wget sqlite3 php7.4-fpm php7.4-sqlite3 php7.4-mbstring

Step 2: Clone the PurritoBin Repository

Next, clone the PurritoBin repository using the following command:

git clone https://github.com/PurritoBin/PurritoBin.git

Navigate to the cloned directory using the following command:

cd PurritoBin

Step 3: Install Composer

Composer is a dependency manager for PHP. In this step, you will install Composer using the following command:

wget https://getcomposer.org/download/latest-stable/composer.phar

sudo mv composer.phar /usr/local/bin/composer

sudo chmod +x /usr/local/bin/composer

Step 4: Install PurritoBin Dependencies

Now you need to install the PurritoBin dependencies. Run the following command to install the dependencies:

sudo composer install --no-plugins --no-scripts

Step 5: Configure Nginx

Create a new Nginx server block file for PurritoBin using the following command:

sudo nano /etc/nginx/sites-available/purritobin

Add the following configuration to the file:

server {
    listen 80;
    server_name example.com; # Replace with your domain name
    root /home/user/PurritoBin/public;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html index.php;

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

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
    }
}

Save and close the file by pressing Ctrl + X, Y, and then Enter.

Step 6: Enable the Nginx Server Block and Reload Configuration

Enable the PurritoBin server block you have just created using the following command:

sudo ln -s /etc/nginx/sites-available/purritobin /etc/nginx/sites-enabled/

Check the Nginx configuration is valid using the following command:

sudo nginx -t

If the configuration file is valid, reload Nginx using the following command:

sudo systemctl reload nginx

Step 7: Modify the PurritoBin Configuration File

Open the config.php file and modify it:

cd /home/user/PurritoBin

nano config.php

Update the following values:

$config['app']['url'] = 'http://example.com'; # Replace with your domain name

$config['db']['file'] = '/home/user/PurritoBin/database/db.sqlite'; # Change directory and file name as per your requirement

Save and close the file by pressing Ctrl + X, Y, and then Enter.

Step 8: Initialize the Database

Initialize the PurritoBin database using the following command:

sudo php artisan migrate

Step 9: Run PurritoBin

Start the PHP server using the following command:

sudo php artisan serve

PurritoBin should now be accessible at http://localhost:8000.

Step 10: Test PurritoBin

Test PurritoBin by creating a new paste and sharing it with someone else.

Congratulations! You have successfully installed PurritoBin 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!