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.
By Simon Vasconcelos Lee
Published on 30 November 202612 minute read
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..env.docker.example: set your domain, an APP_KEY and two database passwords, then run the four setup commands of the official guide.php artisan user:create: registration is closed by default and email verification is on.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.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.
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 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.
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:
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:
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:
docker compose up -d
until curl -sf http://127.0.0.1:8111/healthcheck >/dev/null; do sleep 5; done
docker compose ps
pixelfed serves the site with FrankenPHP and runs the database migrations when it starts, horizon processes the queues (photos, timelines, federation) and scheduler runs the scheduled tasks. The x-pixelfed block holds what they share, so the image tag is written only once.127.0.0.1: the official file publishes it on every address of the server. Published locally, here on port 8111, Pixelfed is reachable only through the reverse proxy.mysql:9, which pointed to 9.7 when we tested, and 9.7 refuses one of Pixelfed’s migrations (issue #7640 of the project, where 8.4 is the workaround). We saw the same failure on our VPS, and none with 8.4.healthcheck-frankenphp on the path /up, but the v0.15.2 image, built on version 5 of its base image, no longer includes that command. Without these two lines, the image checks its own /healthcheck path, which answers once the migrations are done; horizon and scheduler wait for it.pixelfed_storage volume is filled from the image on its first start, with the right owner. It holds the photos, the federation and OAuth keys and the logs.v0.15.2 rather than a moving tag, so that you choose when each update happens.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.
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.
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:
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
--is_admin=true gives the account the admin dashboard, under /i/admin/dashboard.--confirm_email=1 marks its address as verified, so that it can sign in before any email is configured./login with the email address and the password from admin-password.txt, change the password under Settings, then delete the file.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.
pixelfed.example.com {
reverse_proxy 127.0.0.1:8111
}
systemctl reload caddy
@admin@pixelfed.example.com, are built from APP_DOMAIN. Choose it before your first post, since other servers remember it.TRUSTED_PROXY="local", the default of the example file, trusts the private network of Docker, through which Caddy reaches the container. Pixelfed then builds its links in HTTPS and marks its cookies secure, which we checked.To check the site, the federation and the version from the server:
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.
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.
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:
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
--no-tablespaces lets the pixelfed user dump its database without the PROCESS privilege that MySQL 8 asks for tablespaces.Schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.
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:
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.
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.
docker compose pull
docker compose up -d
docker compose exec pixelfed php artisan app:home-feed-rebuild --active 7 --local --network
/api/nodeinfo/2.0.json still reported 0.15.1 for a while, while the application already ran 0.15.2.dev tag follows the development branch: stay on releases.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.
| Topic | Our teams | You |
|---|---|---|
| The server | System and security updates, server interventions included | The timing that suits you |
| Monitoring | Server monitored 24/7, with intervention without waiting for your call | Your members, your moderation and your settings in Pixelfed |
| Pixelfed | Proactive monitoring: errors, slowdowns, queues, database and disk space spotted, fix recommended | Its installation, updates and settings, which you apply, yourself or through your AI assistant |
| Members | The server that carries them, monitored and backed up | Accounts, registration and moderation |
| Backups | Every night, encrypted and kept off the machine; restores included | Pixelfed’s own database dumps and storage archives, and the restore request, when you need one |
| Migration | Your current server migrated, free of charge | The 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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Simafri
Let's talk about your project
Tell us what you need in a few words: we will get back to you quickly.
Thank you! Your request has been sent. We'll get back to you shortly.
Prefer email? Write to us at support@simafri.com.