2026-11-26 · wallabag · docker · self-hosting · read-it-later
Run wallabag in Docker: Self-Hosted Read-It-Later Setup
Deploy wallabag with Docker Compose, PostgreSQL, and Redis. Covers volumes, HTTPS reverse proxy, backups, and hardening for a private read-it-later app.
- Total RAM
- 95.5 MB
- Startup
- 149.5 s
- Port
- 8000
- HTTP
- 302
wallabag 64.0 MB
· db 23.3 MB
· redis 8.2 MB
What wallabag does and what it needs
wallabag is a self-hosted read-it-later service. You save a URL, it extracts the article content, strips ads and pop-ups, and stores a clean copy you can read later from the web UI, mobile apps, or browser extensions. Everything stays on your server.
Under the hood it’s a PHP application (Symfony) backed by a database and Redis for caching and sessions. The upstream project does not publish a minimum memory figure. Idle memory is modest, but content extraction and full-text search on large archives will scale with CPU and RAM. Plan for at least 1 GB to be comfortable, and more if you save hundreds of articles per day.
The official compose.yaml in the repository is a development setup: it bind-mounts the source tree, builds a custom PHP image, and expects docker/php/env to exist. For production you want a prebuilt image, a persistent database, and no source bind mounts. This guide builds that stack.
Prerequisites, ports, and volume constraints
- Docker Engine 24+ and Docker Compose v2.
- A domain name pointing to your server (for HTTPS).
- The
wallabag/wallabagimage listens on port80internally. We map it to127.0.0.1:8000so only the reverse proxy can reach it. - Three named volumes are required:
wallabag_data→/var/www/wallabag/data(application data and SQLite DB if used).wallabag_images→/var/www/wallabag/web/assets/images(downloaded article images).
- A database volume (
wallabag_db) for PostgreSQL. The official compose comments out Postgres and defaults to SQLite; for production we enable Postgres explicitly. - Redis is used for sessions and caching. The official compose includes it; we keep it.
Do not mount /var/run/docker.sock or host paths into the container. All state lives in named volumes.
Production Docker Compose setup
Create a directory and drop in the compose file and .env.
mkdir -p ~/wallabag && cd ~/wallabag
cat <<'EOF' > compose.yml
services:
wallabag:
image: wallabag/wallabag:latest
restart: unless-stopped
environment:
SYMFONY__ENV__DATABASE_DRIVER: pdo_pgsql
SYMFONY__ENV__DATABASE_HOST: db
SYMFONY__ENV__DATABASE_PORT: 5432
SYMFONY__ENV__DATABASE_NAME: wallabag
SYMFONY__ENV__DATABASE_USER: wallabag
SYMFONY__ENV__DATABASE_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: wallabag
POSTGRES_PASSWORD: ${DB_PASSWORD}
SYMFONY__ENV__REDIS_HOST: redis
SYMFONY__ENV__REDIS_PORT: 6379
SYMFONY__ENV__DOMAIN_NAME: ${WALLABAG_BASE_URL:-http://127.0.0.1:8000}
SYMFONY__ENV__SECRET: ${APP_SECRET}
POPULATE_DATABASE: "True"
TZ: ${TZ:-UTC}
volumes:
- wallabag_data:/var/www/wallabag/data
- wallabag_images:/var/www/wallabag/web/assets/images
ports:
- "127.0.0.1:8000:80"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: wallabag
POSTGRES_USER: wallabag
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- wallabag_db:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wallabag -d wallabag"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
- wallabag_redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
volumes:
wallabag_data:
wallabag_images:
wallabag_db:
wallabag_redis:
EOF
Generate secrets and write .env:
cat <<EOF > .env
DB_PASSWORD=$(openssl rand -hex 32)
APP_SECRET=$(openssl rand -hex 32)
WALLABAG_BASE_URL=https://read.example.com
TZ=UTC
EOF
Start the stack:
docker compose up -d
Wait for the database healthcheck, then open http://127.0.0.1:8000 via SSH tunnel to confirm it’s up:
ssh -L 8000:127.0.0.1:8000 user@your-server
Then visit http://localhost:8000 in your browser. The first account you create becomes the admin.
Reverse proxy, HTTPS, and first-run hardening
wallabag needs a reverse proxy that forwards the real scheme and host. Use Caddy or Nginx on the host (not in this compose file) to terminate TLS on 443 and proxy to 127.0.0.1:8000.
Caddy example (/etc/caddy/Caddyfile):
read.example.com {
reverse_proxy 127.0.0.1:8000 {
header_up X-Forwarded-Proto {scheme}
header_up X-Forwarded-For {remote_host}
header_up Host {host}
}
encode gzip
request_body {
max_size 50MB
}
}
Nginx example:
server {
listen 443 ssl http2;
server_name read.example.com;
client_max_body_size 50M;
location / {
proxy_pass http://127.0.0.1:8000;
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;
}
}
Set WALLABAG_BASE_URL to your public HTTPS URL. This value is used for generated links and cookies; if it’s wrong, logins and password resets break.
First-run hardening:
- Create the admin account immediately after the stack is up. wallabag does not ship a default password, but an open registration page is still a risk.
- In the admin settings, disable public registration (
Settings → Users → Allow users to register). - Enable two-factor authentication for the admin account if you plan to expose it publicly.
- Set
SYMFONY__ENV__SECRET(we useAPP_SECRET) to a long random value. Changing it later invalidates sessions. - Keep the container port bound to
127.0.0.1. If you need to test without a domain, use an SSH tunnel as shown above; do not expose port 8000 on the public interface.
Updating, backups, and common pitfalls
Update wallabag and its dependencies:
cd ~/wallabag
docker compose pull
docker compose up -d
Back up the database and data volume:
docker compose exec db pg_dump -U wallabag wallabag > wallabag-$(date +%F).sql
docker run --rm -v wallabag_wallabag_data:/data -v $(pwd):/backup alpine tar czf /backup/wallabag-data-$(date +%F).tar.gz -C /data .
Restore by reversing the commands: psql the dump into a fresh database and untar the data volume.
Common pitfalls:
- Wrong
WALLABAG_BASE_URL: If you change domains, update.envand restart. Cookies and generated URLs will otherwise point to the old host. - Missing PHP extensions: The official image includes them, but if you build your own, ensure
pdo_pgsql,gd,intl,tidy, andbcmathare present. The requirements page lists the full set. - Database migrations on upgrade: wallabag runs migrations on container start. If you see errors, check
docker compose logs wallabagand ensure the database user has schema privileges. - Redis persistence: We mount
wallabag_redisso sessions survive restarts. If you skip it, users get logged out on every restart.
Measured in our sandbox run: total memory 95.5 MB (sum of per-container peaks over a 30s idle window after startup) across 3 containers; largest container 64.0 MB; published port(s) 8000; HTTP probe returned 302. The run took 149.5s including the image download. Required secret(s) APP_SECRET, DB_PASSWORD were generated for the test run, as the tutorial instructs. Container breakdown: wallabag 64.0 MB, db 23.3 MB, redis 8.2 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.