How to Install PixelFed on Linux Mint Latest?

PixelFed is a free and open-source social network platform. It is similar to Instagram, but it is decentralized and privacy-focused. In this tutorial, we will guide you through the steps to install PixelFed on Linux Mint Latest.

Prerequisites

Step 1: Install Required Packages

First, update your server packages by running the following command:

sudo apt update && sudo apt upgrade -y

PixelFed requires some packages to be installed on the server. Run the following command to install them:

sudo apt install -y nginx git curl zip unzip redis-server php7.4 php7.4-fpm \
php7.4-common php7.4-curl php7.4-mbstring php7.4-redis php7.4-xml \
php7.4-mysql php7.4-gd php7.4-zip php7.4-bcmath

Step 2: Install Composer

Composer is a package manager for PHP. PixelFed requires Composer to be installed on the server. Follow the below steps to install it.

curl -sS https://getcomposer.org/installer -o composer-setup.php
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer
rm composer-setup.php

Step 3: Create PHP Configuration File

PixelFed requires additional PHP configurations to work. Create a new configuration file /etc/php/7.4/fpm/pixelfed.ini using the following command:

sudo nano /etc/php/7.4/fpm/pixelfed.ini

Paste in the following PHP configuration:

max_execution_time = 3000
max_input_time = 600
memory_limit = 512M
post_max_size = 128M
upload_max_filesize = 128M

Save and close the file by pressing CTRL + X, then Y and then ENTER.

Step 4: Install PixelFed

Install PixelFed by issuing the following commands:

cd /var/www/
sudo git clone https://github.com/pixelfed/pixelfed.git
cd pixelfed
sudo composer install --no-dev --prefer-dist
sudo php artisan pixelfed:install

The above commands will clone the PixelFed repository from GitHub and install all the required dependencies.

During the installation process, you will need to provide your database details and other configurations. Follow the on-screen prompts to complete the installation.

Step 5: Configure Nginx

Create a new Nginx server block /etc/nginx/sites-available/pixelfed using the following command:

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

Add the following Nginx configuration:

server {
    listen 80;
    server_name YOUR_DOMAIN_OR_IP;

    root /var/www/pixelfed/public;
    index index.php index.html;

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

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

    location ~* \.(js|css)$ {
        add_header Cache-Control "public, max-age=86400, immutable" always;
    }
}

Replace YOUR_DOMAIN_OR_IP with your domain name or IP address.

Save and close the file by pressing CTRL + X, then Y and then ENTER.

Then, create a symbolic link to make the server block active:

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

Finally, test the Nginx configuration:

sudo nginx -t

If there are no errors, restart Nginx to apply the new configuration:

sudo systemctl restart nginx

Step 6: Configure Firewall

Allow traffic on port 80 to access PixelFed. Run the following command to allow HTTP traffic:

sudo ufw allow 80/tcp

If you use HTTPS, then also allow traffic on port 443:

sudo ufw allow 443/tcp

Step 7: Access PixelFed

Open your web browser and navigate to http://YOUR_DOMAIN_OR_IP. You will see the PixelFed welcome page.

Follow the instructions to create a new account and start using PixelFed.

Conclusion

In this tutorial, you learned how to install PixelFed on Linux Mint Latest. Now you can create your own decentralized and privacy-focused social network.

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!