How to install pixelfed on ubuntu vps
We discuss how to install pixelfed on ubuntu vps!

This article provides a guide for how to install Pixelfed on Ubuntu VPS.

What is Pixelfed?

PixelFed is a decentralized, open-source photo-sharing platform similar to Instagram but built on the Fediverse (federated social networks using the ActivityPub protocol). It allows users to host their own instances and interact with users across different servers, much like how Mastodon works for microblogging.

For those desiring to switch from mainstream social media platforms for a more privacy-conscious scenario or desiring a personalized social media platform for their community, Pixelfed is a great solution.

Key Features of PixelFed:

  • Decentralized: No single company controls PixelFed. Multiple instances (servers) can operate independently but still communicate with each other.
  • Privacy-Focused: Users have control over their data, with features like end-to-end encryption and no ads or tracking.
  • Instagram-Like Interface: Features include photo posts, stories, albums, and filters.
  • Federation: Users can follow and interact with accounts from other federated services like Mastodon, Pleroma, and PeerTube.
  • Self-Hosting: Businesses or individuals can create and manage their own PixelFed instances.

Why Use PixelFed?

  • For Photographers & Artists: No algorithmic timeline—followers see posts in chronological order.
  • For Privacy Advocates: No ads, tracking, or data harvesting.
  • For Businesses & Creators: A unique platform to engage with audiences outside mainstream social media.

SEE ALSO: How to Install PeerTube on Ubuntu VPS

How to Install Pixelfed on Ubuntu VPS

This blog post offers a comprehensive step-by-step guide on installing Pixelfed on a freshly installed Ubuntu Virtual Private Server (VPS).

Launch 100% ssd ubuntu vps from $2. 49/mo!

Prerequisites:

Before we discuss how to install Pixelfed on Ubuntu VPS, ensure the following prerequisites are met:

  1. Ubuntu 20.04 or newer version installed on your Ubuntu VPS.
  2. Root or sudo access to your VPS.
  3. Basic knowledge of working with the command line.

Step 1: Update Your System

Before starting the installation process, it is advisable to update your system. SSH your VPS as root or root-equivalent user, and run the following commands:

sudo apt update && sudo apt upgrade -y

Step 2: Install Required PHP Modules

You need to install specific PHP modules for Pixelfed to work correctly. Use the following command:

sudo apt install php php-curl php-gd php-mbstring php-xml php-redis php-zip php-fpm php-bcmath -y

Step 3: Install and Configure PostgreSQL Database

Pixelfed uses PostgreSQL database. Install it using:

sudo apt install postgresql postgresql-contrib -y

After installing, create a new PostgreSQL user and database for Pixelfed:

sudo -u postgres createuser pixelfed
sudo -u postgres createdb pixelfed
sudo -u postgres psql
psql=# alter user pixelfed with encrypted password 'your_password';
psql=# grant all privileges on database pixelfed to pixelfed;
psql=# \q

Step 4: Install and Configure Redis Server

The Redis server is essential for handling caching in Pixelfed:

sudo apt install redis-server -y

Step 5: Install Composer

Composer is a tool used in PHP to manage dependencies. Install it using:

sudo apt install composer -y

Step 6: Install Pixelfed

You can clone Pixelfed from its GitHub repository and install it:

cd /var/www/
sudo git clone https://github.com/pixelfed/pixelfed.git
cd pixelfed
sudo composer install --no-ansi --no-interaction --no-progress --no-suggest

Step 7: Configure Pixelfed

Create a configuration file and update your database credentials:

sudo cp .env.example .env
sudo nano .env

Fill in your DB_USERNAME, DB_PASSWORD, and APP_URL values.

Step 8: Run Migrations and Initialize Pixelfed

Now, you are ready to run migrations and seed the database:

php artisan migrate
php artisan horizon

Following these steps should successfully install Pixelfed on your VPS.

Buy ubuntu vps at 50% off

Federation Setup for PixelFed

Federation allows your PixelFed instance to connect and communicate with other servers in the Fediverse, such as Mastodon, Pleroma, and other PixelFed instances.

  1. Enable Federation in PixelFed

    Open your .env file and make sure these settings are correctly configured:

    nano /var/www/pixelfed/.env

    Modify the following values:

    # Federation settings ACTIVITYPUB=true AP_REMOTE_FOLLOW=true AP_INBOX=true AP_OUTBOX=true AP_SIGNING=true AP_SHAREDINBOX=true AP_WELLKNOWN=true AP_PRIVATE_FOLLOW=true AP_HEALTH_CHECK=true AP_PUBLIC_COLLECTIONS=true AP_URI_SCHEME=https

    Save and exit (CTRL + X, then Y).

    Then, clear the cache and restart the queue worker:

    php artisan config:cache php artisan route:cache php artisan view:cache php artisan queue:restart
  2. Enable WebFinger and NodeInfo

    WebFinger and NodeInfo allow other servers to discover and interact with your instance.

    Run the following command:

    php artisan federation:discover
    

    Then, verify that these endpoints work:

    • WebFinger:
      Open in a browser or use curl:

      https://pixelfed.example.com/.well-known/webfinger?resource=acct:yourusername@pixelfed.example.com
    • NodeInfo:
       https://pixelfed.radwebhosting.com/.well-known/nodeinfo

    Both should return JSON responses with metadata about your instance.

  3. Configure Nginx for Federation

    Make sure Nginx allows access to the .well-known directories. Open your Nginx config:

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

    Add the following inside the server {} block:

    location /.well-known/webfinger { add_header Access-Control-Allow-Origin "*"; rewrite ^/.well-known/webfinger /public/.well-known/webfinger last; } location /.well-known/nodeinfo { add_header Access-Control-Allow-Origin "*"; rewrite ^/.well-known/nodeinfo /public/.well-known/nodeinfo last; } location /.well-known/host-meta { add_header Access-Control-Allow-Origin "*"; rewrite ^/.well-known/host-meta /public/.well-known/host-meta last; } location /.well-known/host-meta.json { add_header Access-Control-Allow-Origin "*"; rewrite ^/.well-known/host-meta.json /public/.well-known/host-meta.json last; }

    Save and exit (CTRL + X, then Y).

    Then, restart Nginx:

    sudo systemctl restart nginx
  4. Test Federation

    1. Create a Test Account on your PixelFed instance.
    2. Try following a Mastodon or another PixelFed user (e.g., @radwebhosting@mastodon.social).
    3. Check Federation Logs:
      php artisan queue:work

      If there are errors, they will show up here.

  5. Announce Your Instance to the Fediverse

    Once everything is working, make a public post with hashtags like:

    • #NewInstance
    • #PixelFed
    • #Fediverse

    Tagging @pixelfed@pixelfed.social can also help other instances discover yours.

  6. (Optional) Monitor Federation Activity

    You can monitor your instance’s federation activity using:

    php artisan federation:monitor

Buy ubuntu vps at 50% off

Conclusion

You now know how to install Pixelfed on Ubuntu VPS!

Using this setup, you can launch your own privacy-centric and highly customizable social media platform. Enjoy your new Pixelfed installation!

Share this:
Avatar of editorial staff

Editorial Staff

Rad Web Hosting is a leading provider of web hosting, Cloud VPS, and Dedicated Servers in Dallas, TX.

2 thoughts on “How to Install Pixelfed on Ubuntu VPS (8 Step Quick-Start Guide)

  1. […] could complement your PixelFed instance by offering an independent, self-branded image hosting […]

Comments are closed.

lg