Pixelfed
Photo sharing the way it should be, without algorithmic barriers
Alternative to: Instagram
Pixelfed is a free, open-source photo and video sharing platform built on ActivityPub, offering an alternative to Instagram without algorithmic feeds or ads. It federates with the wider fediverse, so people on one Pixelfed server can follow and interact with users on Mastodon, PeerTube, and other ActivityPub-based software. Anyone can run their own instance and set their own moderation policy.
Pixelfed Docker Compose example
Self-host Pixelfed on your own server, homelab, or VPS starting from this Docker Compose example.
It runs Pixelfed in Docker containers using the official ghcr.io/pixelfed/pixelfed:latest, ghcr.io/pixelfed/pixelfed:latest, mariadb:11, redis:7-alpine images, with persistent volumes and automatic restarts preconfigured.
Review the environment variables and adjust them to your setup, save the file as compose.yml (or docker-compose.yml), and start the stack with docker compose up -d.
# Shared Pixelfed application environment, used by the app, worker and
# scheduler services (they run the same image with the same configuration).
x-pixelfed-env: &pixelfed-env
APP_NAME: "Pixelfed"
APP_ENV: "production"
APP_DEBUG: "false"
# Laravel application encryption key. Regenerate with:
# echo "base64:$(openssl rand -base64 32)"
APP_KEY: "base64:nikV2IvVSaihCY1UErbTO4/T6asPUpfbEud1rA0DsVI="
# Public URL of your Pixelfed instance (scheme included).
APP_URL: "https://pixelfed.example.com"
# Domain of your Pixelfed instance (no scheme).
APP_DOMAIN: "pixelfed.example.com"
# Domain used for the admin panel (usually the same as APP_DOMAIN).
ADMIN_DOMAIN: "pixelfed.example.com"
# Keep "null" unless you share session cookies across subdomains.
SESSION_DOMAIN: "null"
# Allow new users to register through the web UI.
OPEN_REGISTRATION: "false"
# Require new users to verify their email address.
ENFORCE_EMAIL_VERIFICATION: "true"
# List this instance on the public directory.
INSTANCE_DISCOVER_PUBLIC: "true"
# Enable ActivityPub federation.
ACTIVITY_PUB: "true"
DB_CONNECTION: "mysql"
DB_HOST: "db"
DB_PORT: "3306"
DB_DATABASE: "pixelfed"
DB_USERNAME: "pixelfed"
# Password for the bundled MySQL database (internal to the compose network).
DB_PASSWORD: "pixelfed_db_password"
REDIS_HOST: "redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: "null"
CACHE_DRIVER: "redis"
SESSION_DRIVER: "database"
QUEUE_DRIVER: "redis"
BROADCAST_DRIVER: "log"
# TLS is terminated by the reverse proxy in front of Pixelfed.
SSL_MODE: "off"
services:
pixelfed:
image: ghcr.io/pixelfed/pixelfed:latest
environment:
<<: *pixelfed-env
# Run database migrations and create the storage symlink on boot.
AUTORUN_ENABLED: "true"
AUTORUN_LARAVEL_MIGRATION: "true"
AUTORUN_LARAVEL_MIGRATION_ISOLATION: "true"
AUTORUN_LARAVEL_STORAGE_LINK: "true"
AUTORUN_LARAVEL_CONFIG_CACHE: "true"
AUTORUN_LARAVEL_ROUTE_CACHE: "true"
AUTORUN_LARAVEL_VIEW_CACHE: "true"
volumes:
- app_storage:/var/www/html/storage
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
worker:
image: ghcr.io/pixelfed/pixelfed:latest
command: ["php", "artisan", "horizon"]
environment:
<<: *pixelfed-env
AUTORUN_ENABLED: "false"
AUTORUN_LARAVEL_STORAGE_LINK: "true"
AUTORUN_LARAVEL_CONFIG_CACHE: "true"
volumes:
- app_storage:/var/www/html/storage
depends_on:
pixelfed:
condition: service_started
restart: unless-stopped
db:
image: mariadb:11
environment:
MYSQL_DATABASE: "pixelfed"
MYSQL_USER: "pixelfed"
# Must match DB_PASSWORD above (internal to the compose network).
MYSQL_PASSWORD: "pixelfed_db_password"
# Root password for the bundled MariaDB database (internal only).
MYSQL_ROOT_PASSWORD: "pixelfed_root_password"
volumes:
- db_data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
restart: unless-stopped
redis:
image: redis:7-alpine
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis_data:/data
restart: unless-stopped
volumes:
app_storage:
db_data:
redis_data: Prefer a managed setup? WinterFlow installs, configures, and updates Pixelfed for you using this same Docker Compose configuration.