VPSFolio

2026-11-24 · freshrss · rss · docker · self-hosting

Self-Host FreshRSS with Docker: Production Compose Guide

Run FreshRSS, a lightweight self-hosted RSS/Atom aggregator, with Docker Compose, PostgreSQL, and a Caddy reverse proxy for HTTPS.

Bench run · 2026-11-24 Verified
FreshRSS/FreshRSS
Total RAM
53.5 MB
Startup
59.5 s
Port
8080
HTTP
302
Per container db 34.7 MB · freshrss 18.9 MB
freshrss/freshrss:latest · 2 containers · FreshRSS/FreshRSS

What FreshRSS does and what it needs

FreshRSS is a self-hosted RSS/Atom feed aggregator. It’s lightweight, multi-user, supports anonymous reading, tags, WebSub push, XPath web scraping, and exposes a Google Reader API plus a Fever API for native mobile clients. It also ships a CLI for maintenance tasks.

Under the hood it’s a PHP 8.2+ application backed by PostgreSQL, MariaDB/MySQL, or SQLite. The official Docker image bundles PHP and the required extensions, so you only need to supply a database and a writable ./data/ volume. The project does not publish a minimum RAM figure; idle instances with a few hundred feeds run comfortably on small VPSes, while heavy refresh schedules and large article backlogs scale with CPU and disk I/O.

Prerequisites, ports, and volume constraints

  • Docker Engine 24+ and the Compose v2 plugin.
  • A domain name pointing at your server (for HTTPS).
  • Port 80/443 free for the reverse proxy; FreshRSS itself listens on 8080 inside the container.
  • Two persistent volumes: one for the FreshRSS data/ directory (users, feeds, config, logs) and one for PostgreSQL.

The ./data/ folder holds all personal data and must never be exposed to the web. Only the ./p/ folder is meant to be public, and the Docker image handles that routing internally.

Production Docker Compose setup

Create the project directory and the .env file first. Generate real secrets — never reuse defaults.

mkdir -p /opt/freshrss && cd /opt/freshrss
cat <<'EOF' > .env
TZ=UTC
DB_PASSWORD=REPLACE_ME
BASE_URL=https://rss.example.com
[email protected]
EOF
sed -i "s|REPLACE_ME|$(openssl rand -hex 32)|" .env

Now write the Compose file. The web port is bound to 127.0.0.1 so only the reverse proxy can reach it.

cat <<'EOF' > compose.yml
services:
  freshrss:
    image: freshrss/freshrss:latest
    container_name: freshrss
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
    ports:
      - "127.0.0.1:8080:80"
    environment:
      TZ: ${TZ:-UTC}
      CRON_MIN: "*/20"
      BASE_URL: ${BASE_URL}
      DB_HOST: db
      DB_BASE: freshrss
      DB_USER: freshrss
      DB_PASSWORD: ${DB_PASSWORD}
    volumes:
      - freshrss_data:/var/www/FreshRSS/data
      - freshrss_extensions:/var/www/FreshRSS/extensions

  db:
    image: postgres:16-alpine
    container_name: freshrss-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: freshrss
      POSTGRES_USER: freshrss
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      TZ: ${TZ:-UTC}
    volumes:
      - freshrss_db:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U freshrss -d freshrss"]
      interval: 10s
      timeout: 5s
      retries: 10

volumes:
  freshrss_data:
  freshrss_extensions:
  freshrss_db:
EOF

Start the stack:

docker compose up -d
docker compose logs -f freshrss

Open http://127.0.0.1:8080 via SSH tunnel (ssh -L 8080:127.0.0.1:8080 user@server) to finish the first-run wizard. Pick PostgreSQL, use host db, database freshrss, user freshrss, and the password from .env. Create the admin account immediately — the wizard is open to anyone who can reach the port until you do.

Reverse proxy, HTTPS, and first-run hardening

FreshRSS needs X-Forwarded-Proto and X-Forwarded-For so it generates correct URLs and logs real client IPs. It also uses WebSub callbacks, so the proxy must forward the Host header unchanged and allow reasonably large request bodies (OPML imports and article payloads).

Example Caddyfile:

rss.example.com {
  encode zstd gzip
  request_body {
    max_size 20MB
  }
  reverse_proxy 127.0.0.1:8080 {
    header_up X-Forwarded-Proto {scheme}
    header_up X-Forwarded-Host {host}
  }
}

For Nginx, mirror the same headers:

server {
  listen 443 ssl http2;
  server_name rss.example.com;
  client_max_body_size 20m;

  location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
}

After the wizard, log in as admin and:

  1. Set Base URL to your public HTTPS URL under Administration → System configuration.
  2. Disable anonymous reading unless you actually want it.
  3. Enable the built-in cron (CRON_MIN is already set) so feeds refresh without a logged-in browser.
  4. If you use the Google Reader API for mobile clients, generate API passwords per user rather than sharing the login password.

Updating, backups, and common pitfalls

Update the image and restart:

cd /opt/freshrss
docker compose pull
docker compose up -d
docker compose logs --tail=50 freshrss

Back up both the database and the data volume. The database holds articles and read state; the volume holds user configs, extensions, and logs.

docker compose exec -T db pg_dump -U freshrss freshrss | gzip > backup-$(date +%F).sql.gz
docker run --rm -v freshrss_data:/data -v $(pwd):/backup alpine \
  tar czf /backup/freshrss-data-$(date +%F).tar.gz -C /data .

Two pitfalls worth knowing:

  • Exposing ./data/: the docs are explicit that only ./p/ should be web-accessible. If you front the container with a proxy that rewrites paths or serves static files from the volume, you can leak user data. Keep the proxy as a pure reverse proxy.
  • Stale BASE_URL: if you change domains and forget to update BASE_URL (and the admin setting), WebSub callbacks, API clients, and password reset links break silently. Update both the env var and the admin panel in the same maintenance window.

Measured in our sandbox run: total memory 53.5 MB (sum of per-container peaks over a 30s idle window after startup) across 2 containers; largest container 34.7 MB; published port(s) 8080; HTTP probe returned 302. The run took 59.5s including the image download. Required secret(s) BASE_URL, DB_PASSWORD were generated for the test run, as the tutorial instructs. Container breakdown: db 34.7 MB, freshrss 18.9 MB.


Verification: we ran this docker-compose stack in a disposable Docker environment and recorded the measurements above. They describe that run, not a guarantee for your host.