VPSFolio

2026-11-23 · filebrowser · docker · self-hosting · file-manager

File Browser Docker: Self-Host a Web File Manager

Run File Browser in Docker with Redis cache, TLS reverse proxy, and hardened first-run setup. Includes backup and update commands.

Bench run · 2026-11-24 Verified
filebrowser/filebrowser
Total RAM
30.6 MB
Startup
61.3 s
Port
8000
HTTP
200
Per container redis 18.4 MB · filebrowser 12.2 MB
filebrowser/filebrowser:latest · 2 containers · filebrowser/filebrowser

What File Browser does and what it needs

File Browser gives you a web UI over a directory tree: upload, delete, preview, edit, and share files. Point it at a path, and it serves that path through a browser. The upstream project is archived as of 2026-09-01 and will get no further security fixes, so treat it as unmaintained. The README is explicit: do not expose it directly to the internet, keep the command runner disabled, and run it unprivileged in a container with only the directory you intend to serve mounted.

The official compose file pairs File Browser with Redis for caching. File Browser itself is a single Go binary; Redis is optional but the upstream compose wires it in via FB_REDIS_CACHE_URL. The project does not publish a minimum RAM figure. Idle memory is small; heavy directory listings, thumbnail generation, and concurrent uploads are the real scaling factors.

Prerequisites, ports, and volume constraints

  • Docker Engine 24+ and the Compose plugin.
  • A host directory you want to expose. Create it and set ownership before starting the stack.
  • Port 80 inside the container is the web UI. The official compose maps 8000:80; we bind it to 127.0.0.1:8000 so a reverse proxy can terminate TLS.
  • Two named volumes: filebrowser for the database and config, and redis for cache persistence. The served directory is a bind mount, not a named volume, because you need to reach it from the host.
  • No published RAM requirement. Plan for a few hundred MB of headroom on a small VPS; Redis adds a small fixed cost.

Create the served directory and lock down permissions:

sudo mkdir -p /srv/filebrowser/data
sudo chown -R 1000:1000 /srv/filebrowser/data
sudo chmod 750 /srv/filebrowser/data

Production Docker Compose setup

Write the compose file. It follows the upstream structure but pins the web port to localhost, adds a healthcheck, and uses environment variables for the Redis password.

cat <<'EOF' > compose.yml
services:
  filebrowser:
    container_name: filebrowser
    image: filebrowser/filebrowser:latest
    restart: unless-stopped
    networks:
      - filebrowser
    ports:
      - "127.0.0.1:8000:80"
    volumes:
      - filebrowser:/database
      - filebrowser_data:/srv
    environment:
      - FB_REDIS_CACHE_URL=redis://default:${REDIS_PASSWORD}@redis:6379
      - TZ=${TZ:-UTC}
    depends_on:
      redis:
        condition: service_healthy

  redis:
    container_name: filebrowser-redis
    image: redis:7-alpine
    restart: unless-stopped
    networks:
      - filebrowser
    command:
      - sh
      - -c
      - |
        cat > /tmp/users.acl <<ACL
        user default on >${REDIS_PASSWORD} ~* +@all
        ACL
        redis-server --aclfile /tmp/users.acl
    volumes:
      - redis:/data
    healthcheck:
      test: ["CMD-SHELL", "redis-cli -a ${REDIS_PASSWORD} ping | grep -q PONG"]
      interval: 10s
      timeout: 3s
      retries: 5

networks:
  filebrowser:

volumes:
  filebrowser:
  filebrowser_data:
  redis:
EOF

Generate secrets and write .env:

cat <<EOF > .env
REDIS_PASSWORD=$(openssl rand -hex 32)
TZ=UTC
EOF
chmod 600 .env

Start the stack:

docker compose up -d
docker compose logs -f filebrowser

On first boot File Browser creates an admin user with a random password printed in the logs. Grab it, then change it immediately:

docker compose logs filebrowser | grep -i password

Reverse proxy, HTTPS, and first-run hardening

File Browser speaks plain HTTP on port 80 inside the container. Put Caddy or Nginx in front and terminate TLS there. The README recommends the proxy also perform its own authentication, because File Browser’s session handling uses self-contained JWTs that cannot be revoked. A leaked token stays valid until expiry.

Caddy example:

files.example.com {
    reverse_proxy 127.0.0.1:8000
    request_body {
        max_size 2GB
    }
}

Nginx example:

server {
    listen 443 ssl http2;
    server_name files.example.com;
    client_max_body_size 2G;

    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;
    }
}

Hardening checklist:

  • Keep the command runner disabled. It is off by default; do not pass --disable-exec=false.
  • Change the generated admin password on first login.
  • Restrict the bind mount to the directory you actually want to serve. Do not mount / or /home.
  • If you need to test without a domain, use an SSH tunnel: ssh -L 8000:127.0.0.1:8000 user@host, then open http://localhost:8000.
  • Do not expose port 8000 on the public interface. The compose file binds it to 127.0.0.1 for this reason.

Updating, backups, and common pitfalls

Update the images and recreate containers:

docker compose pull
docker compose up -d
docker compose ps

Back up the named volumes and the served directory. The database volume holds users, settings, and shares; the served directory holds the actual files.

docker run --rm -v filebrowser_filebrowser:/data -v "$PWD":/backup alpine \
  tar czf /backup/filebrowser-db-$(date +%F).tar.gz -C /data .

sudo tar czf filebrowser-data-$(date +%F).tar.gz -C /srv/filebrowser data

Restore by stopping the stack, extracting the archives back into the volumes, and starting again.

Two real pitfalls from the docs:

  1. JWT sessions cannot be revoked. Logout, password changes, and token renewal leave previously issued tokens valid until they expire. If a token leaks, assume it works until expiry. Rotate the admin password and shorten session lifetimes where possible.
  2. The command runner is a shell on the host. It is disabled by default and should stay that way. Re-enabling it with --disable-exec=false gives anyone with access to the UI the ability to run commands as the container user, which is equivalent to shell access on the mounted directory.

Also note the project is archived. There will be no further releases, bug fixes, or security fixes. Plan a migration path if you depend on it long term.


Measured in our sandbox run: total memory 30.6 MB (sum of per-container peaks over a 30s idle window after startup) across 2 containers; largest container 18.4 MB; published port(s) 8000; HTTP probe returned 200. The run took 61.3s including the image download. Required secret(s) REDIS_PASSWORD were generated for the test run, as the tutorial instructs. Container breakdown: redis 18.4 MB, filebrowser 12.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.