Self-host Pixelfed on a managed VPS: photo sharing on the fediverse

To self-host Pixelfed on a managed VPS is to run a photo sharing community of your own, with your members’ photos on your server, which our teams keep up to date and monitor day and night. Pixelfed is free, open source software under the AGPL-3.0 license, and it federates with the fediverse through ActivityPub. This guide follows its official release image at version 0.15.2, and we ran every command on a Simafri test VPS before writing it: installation with Docker Compose, MySQL and Redis, the first account from the command line, HTTPS, a published photo, backups, a restore and an update.

Simon Vasconcelos Lee By Published on 30 November 202612 minute read

All guides Media, publishing and feeds

In short

  1. The AGPL-3.0 license lets you run Pixelfed for your community, your association or your clients with no license to buy.
  2. Install it with Docker Compose: the release image ghcr.io/pixelfed/pixelfed, MySQL 8.4 and Redis, with a Horizon queue worker and a scheduler from the same image, and port 8080 published on 127.0.0.1 behind an HTTPS reverse proxy.
  3. Start from the project’s .env.docker.example: set your domain, an APP_KEY and two database passwords, then run the four setup commands of the official guide.
  4. Create the first administrator with php artisan user:create: registration is closed by default and email verification is on.
  5. Back up with mysqldump and an archive of storage, which holds the photos and the federation keys. To update, change the image tag: the image migrates the database itself.

What Pixelfed does

Pixelfed is a photo sharing platform written in PHP with the Laravel framework. Its members post photos with a caption and alternative text, follow each other and comment, in a chronological feed with no ranking algorithm. Each instance is independent, and instances talk to each other through ActivityPub, the protocol of the fediverse: people on other Pixelfed instances, or on Mastodon, can follow your members and reply to them.

What the AGPL-3.0 license allows

Pixelfed is published under the GNU Affero General Public License, version 3 (AGPL-3.0). You can use it free of charge, for your community, your association or your clients, copy it and modify it. The AGPL adds one rule to the GPL: if you modify Pixelfed and let people use it over the network, you offer them the source code of your modified version. Running the release image unchanged, as in this guide, asks nothing more of you. The software is provided without warranty.

The resources to plan for

The README recommends PHP 8.5, the version of the image, and supports MySQL 8 or later and MariaDB 11 or later; PostgreSQL is “best effort”, and the image only includes the MySQL driver. Here is what we measured on our test VPS, with 2 vCPUs and 4 GB of memory, after the installation and a first photo:

Server size therefore depends on the number of members, on how many photos they post and on the other applications you run beside Pixelfed. On a managed VPS, tell us about your community and we will recommend the right size.

Installing with Docker Compose

Since September 2026, the README recommends Docker Compose. The official guide, DOCKER_COMPOSE_SETUP.md, clones the repository and builds the image on the server; the project also publishes that image, built from the same Dockerfile by its release workflow, on GitHub’s container registry for each release. We use the published image, which saves the build. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, create a folder such as /opt/pixelfed, and start from the project’s example settings, downloaded for the same version:

Terminal, in /opt/pixelfed
umask 077
curl -fsSL -o .env https://raw.githubusercontent.com/pixelfed/pixelfed/v0.15.2/.env.docker.example
sed -i \
  -e "s|^APP_KEY=.*|APP_KEY=base64:$(openssl rand -base64 32)|" \
  -e 's|^APP_URL=.*|APP_URL="https://pixelfed.example.com"|' \
  -e 's|^APP_DOMAIN=.*|APP_DOMAIN="pixelfed.example.com"|' \
  -e 's|^ADMIN_DOMAIN=.*|ADMIN_DOMAIN="pixelfed.example.com"|' \
  -e "s|^DB_PASSWORD=.*|DB_PASSWORD=\"$(openssl rand -hex 24)\"|" \
  -e "s|^DB_ROOT_PASSWORD=.*|DB_ROOT_PASSWORD=\"$(openssl rand -hex 24)\"|" \
  -e 's|^MAIL_FROM_ADDRESS=.*|MAIL_FROM_ADDRESS="pixelfed@example.com"|' \
  .env
umask 022

The .env file is readable by root only. It sets the domain, a random Laravel key, which encrypts sessions and cookies, and two random database passwords. Keep the other defaults for now: registration closed, email verification required, at most 1,000 users, photos up to 15 MB optimized at quality 80, and ActivityPub on. Then put this compose.yaml next to it, based on the project’s docker-compose.yml:

compose.yaml
x-pixelfed: &pixelfed
  image: ghcr.io/pixelfed/pixelfed:v0.15.2
  restart: unless-stopped
  env_file: .env
  volumes:
    - pixelfed_storage:/var/www/html/storage

services:
  db:
    image: mysql:8.4
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_USER: ${DB_USERNAME}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
    volumes:
      - db_data:/var/lib/mysql
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-p$$MYSQL_ROOT_PASSWORD"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s

  redis:
    image: redis:8.10-alpine
    restart: unless-stopped
    command: redis-server --appendonly yes
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 3s
      retries: 3

  pixelfed:
    <<: *pixelfed
    ports:
      - "127.0.0.1:8111:8080"
    environment:
      LOG_OUTPUT_LEVEL: "error"
      SSL_MODE: "off"
      CADDY_SERVER_EXTRA_DIRECTIVES: |
        @service_worker path /sw.js
        header @service_worker Cache-Control "no-cache"
      PHP_POST_MAX_SIZE: "500M"
      PHP_UPLOAD_MAX_FILE_SIZE: "500M"
      PHP_OPCACHE_ENABLE: "1"
      PHP_OPCACHE_VALIDATE_TIMESTAMPS: "0"
      AUTORUN_ENABLED: "true"
      AUTORUN_LARAVEL_MIGRATION: "true"
      AUTORUN_LARAVEL_MIGRATION_ISOLATION: "true"
      AUTORUN_LARAVEL_STORAGE_LINK: "true"
      AUTORUN_LARAVEL_EVENT_CACHE: "true"
      AUTORUN_LARAVEL_ROUTE_CACHE: "true"
      AUTORUN_LARAVEL_VIEW_CACHE: "true"
      AUTORUN_LARAVEL_CONFIG_CACHE: "true"
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_healthy

  horizon:
    <<: *pixelfed
    command: ["php", "artisan", "horizon"]
    environment:
      PHP_POST_MAX_SIZE: "500M"
      PHP_UPLOAD_MAX_FILE_SIZE: "500M"
      PHP_OPCACHE_ENABLE: "1"
      PHP_OPCACHE_VALIDATE_TIMESTAMPS: "0"
      AUTORUN_ENABLED: "false"
    depends_on:
      pixelfed:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "healthcheck-horizon"]
      interval: 10s
      timeout: 5s
      retries: 3

  scheduler:
    <<: *pixelfed
    command: ["php", "artisan", "schedule:work"]
    stop_signal: SIGTERM
    environment:
      PHP_OPCACHE_ENABLE: "1"
      PHP_OPCACHE_VALIDATE_TIMESTAMPS: "0"
      AUTORUN_ENABLED: "false"
    depends_on:
      pixelfed:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "healthcheck-schedule"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 10s

volumes:
  db_data:
  redis_data:
  pixelfed_storage:
Terminal, in /opt/pixelfed
docker compose up -d
until curl -sf http://127.0.0.1:8111/healthcheck >/dev/null; do sleep 5; done
docker compose ps

On our test VPS, Pixelfed answered about 20 seconds after its container started, migrations included. The official guide then lists four commands, to run once: the instance actor, used to sign federation requests, the cities for post locations, and the OAuth keys and client used by the API and the apps.

Terminal, in /opt/pixelfed
docker compose exec pixelfed php artisan instance:actor
docker compose exec pixelfed php artisan import:cities
docker compose exec pixelfed php artisan passport:keys
docker compose exec pixelfed php artisan passport:client --personal

The import of the 128,769 cities took about ten seconds, and the last command offers the name “Pixelfed” for the client, which you can accept.

The first account

Registration is closed and email verification is on, so the first administrator is created from the command line. The user:create command asks its questions one by one, or takes them as options; here, with a random password kept in a file readable by root only:

Terminal, in /opt/pixelfed
umask 077; openssl rand -hex 12 > admin-password.txt; umask 022
docker compose exec pixelfed php artisan user:create --name="Admin" --username=admin --email=admin@example.com --password="$(cat admin-password.txt)" --is_admin=true --confirm_email=1
docker compose exec pixelfed php artisan user:show admin

HTTPS: the reverse proxy

The container serves Pixelfed over HTTP. HTTPS is handled by a reverse proxy in front of it, which must forward the public Host header and X-Forwarded-Proto. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, forwards these headers and sets no upload limit by default.

/etc/caddy/Caddyfile
pixelfed.example.com {
	reverse_proxy 127.0.0.1:8111
}
Terminal
systemctl reload caddy

To check the site, the federation and the version from the server:

Terminal
curl -sI https://pixelfed.example.com/
curl -s "https://pixelfed.example.com/.well-known/webfinger?resource=acct:admin@pixelfed.example.com"
curl -s https://pixelfed.example.com/api/nodeinfo/2.0.json

On our VPS, Caddy obtained the certificate on its first reload, the home page answered with the title “Pixelfed”, WebFinger returned the acct:admin@… account with its ActivityPub address, and NodeInfo reported pixelfed 0.15.2 with registration closed. The /register page answered 404, a wrong password sent the sign-in form back, and the administrator reached the admin dashboard.

We then published a photo as the administrator, a 640 by 480 JPEG generated on the server, with a caption and alternative text. Pixelfed stored it optimized, from 14 KB to 6 KB, with a thumbnail, and the post page and the photo were served over HTTPS, the post listed in the account’s ActivityPub outbox.

Emails

Pixelfed sends the email verification links, password resets and some notifications. Set the MAIL_ lines of .env to your SMTP relay, port 587 with STARTTLS, with the username and password of the sending account and a MAIL_FROM_ADDRESS on your domain, then run docker compose up -d again so that the containers read them. On a Simafri VPS, applications send through an authenticated SMTP relay on port 587, which also gives your email the best deliverability.

Open registration, if you want it, is a setting of the admin dashboard or of OPEN_REGISTRATION, and new members then confirm their address by email.

Backups

Everything lives in three places: the MySQL database, the pixelfed_storage volume, with the photos, the OAuth and federation keys, and your .env file, whose APP_KEY must stay the same. Redis only holds caches and queues, which Pixelfed rebuilds. The MySQL image includes mysqldump, and the Pixelfed image includes tar:

Terminal, in /opt/pixelfed
umask 077
docker compose exec -T db sh -c 'exec mysqldump --single-transaction --no-tablespaces -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE"' > pixelfed-$(date +%F).sql
docker compose exec -T pixelfed tar -C /var/www/html --exclude=storage/framework/cache -czf - storage > storage-$(date +%F).tar.gz
cp .env env-$(date +%F).bak
umask 022

Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.

Restoring

On the same installation, or on a new one with the same compose.yaml and .env where only docker compose up -d db redis has run, stop Pixelfed, load the dump and the files, then start it again. The mysql client stops at the first error, with a non-zero exit code:

Terminal, in /opt/pixelfed
docker compose stop pixelfed horizon scheduler
docker compose exec -T db sh -c 'exec mysql -u "$MYSQL_USER" -p"$MYSQL_PASSWORD" "$MYSQL_DATABASE"' < pixelfed-2026-11-20.sql
docker compose run --rm --no-deps -T --entrypoint tar pixelfed -C /var/www/html -xzf - < storage-2026-11-20.tar.gz
docker compose up -d

We tested the whole cycle on our VPS: dump and archive, the database dropped and created again empty, the storage volume deleted and Redis emptied, then the restore. Both commands ended with exit code 0, the 133 tables came back, the administrator signed in again, and the post came back with its caption and its photo, whose SHA-256 fingerprint matched the one taken before the backup.

Updates

Pixelfed publishes its releases on GitHub, and each one is built as an image with the same tag; v0.15.2, the most recent when we tested, is a security release. Read the upgrade notes of each release first, and take a backup. Then change the tag in the x-pixelfed block of compose.yaml, pull the new image and recreate the containers: the pixelfed container runs the migrations on its start.

Terminal, in /opt/pixelfed
docker compose pull
docker compose up -d
docker compose exec pixelfed php artisan app:home-feed-rebuild --active 7 --local --network

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; Pixelfed remains your software, with your community, its photos and your settings.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour members, your moderation and your settings in Pixelfed
PixelfedProactive monitoring: errors, slowdowns, queues, database and disk space spotted, fix recommendedIts installation, updates and settings, which you apply, yourself or through your AI assistant
MembersThe server that carries them, monitored and backed upAccounts, registration and moderation
BackupsEvery night, encrypted and kept off the machine; restores includedPixelfed’s own database dumps and storage archives, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

Pixelfed, on a server run for you

With a Simafri Managed VPS, our teams keep your Pixelfed instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is Pixelfed free?

Yes. Pixelfed is under the AGPL-3.0 license: you can run it for your community, your association or your clients with no license to buy. If you modify it and offer it over the network, you share your modified source code. What remains is the cost of the server that runs it.

How do I install Pixelfed with Docker Compose?

Download .env.docker.example for your version as .env, set your domain, APP_KEY and the database passwords, then use the ghcr.io/pixelfed/pixelfed image with MySQL 8.4 and Redis in a compose.yaml, with horizon and scheduler services from the same image. Publish port 8080 on 127.0.0.1, run docker compose up -d, the four setup commands, and put an HTTPS reverse proxy in front.

How do I create the first Pixelfed admin account?

Run php artisan user:create in the pixelfed container. It asks for the name, username, email and password, or takes them as options; --is_admin=true makes the account an administrator and --confirm_email=1 marks its email as verified, so that it can sign in before email is configured.

Why does the Pixelfed migration fail with MySQL 9?

MySQL 9.7 refuses a generated column that uses md5 in the Pulse migration, and the pixelfed container restarts in a loop. The project tracks it in its issue #7640, where MySQL 8.4 is the workaround; MariaDB 11 or later is also supported. We installed with MySQL 8.4.

How much memory does Pixelfed need?

On our test VPS, about 2.4 GB in all for a new instance: Horizon about 1.5 GB with its 16 queue workers, MySQL about 540 MB, the web container about 115 MB, the scheduler about 70 MB and Redis a few MB. The images take about 1.35 GB of disk.

How do I back up Pixelfed in Docker?

Dump the database with mysqldump from the MySQL container, archive /var/www/html/storage from the Pixelfed container without storage/framework/cache, and keep a copy of your .env file. Restore the dump with mysql and the archive with tar, Pixelfed stopped.

How do I update Pixelfed in Docker?

Read the release notes, take a backup, change the image tag in compose.yaml, then run docker compose pull and docker compose up -d: the container runs the migrations. The notes of v0.15.2 also recommend rebuilding the home feeds with php artisan app:home-feed-rebuild.

Does a managed VPS cover Pixelfed?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us