File Browser AutoForge
🚀 Tutorial Website · Self-Hosted File Browser

Deploy File Browser with an auto-detecting Linux script.

This guide explains what the script does, what it installs, how it detects your server, how the Docker image is built, and how users can run it with Docker Compose.

$ ./setup-filebrowser.sh

[OK] Linux detected
[OK] CPU architecture detected
[OK] Missing packages installed only if needed
[OK] Docker or Podman prepared
[BUILD] my-filebrowser image ready

What the script does

The script automates the boring parts: OS detection, CPU architecture detection, package checking, container engine setup, File Browser download, Dockerfile generation, and image build.

Linux detection

Detects Debian, Ubuntu, Fedora, RHEL-like, Arch, openSUSE, Alpine, and their package managers.

CPU detection

Supports AMD64, ARM64, ARMv7, ARMv6, 386, s390x, and ppc64le.

Package-aware

Checks required packages first and installs only what is missing.

Docker first

Uses Docker when available and tries to install/start it when missing.

Podman fallback

Can fall back to Podman if Docker is not usable.

Local image build

Builds my-filebrowser, then Compose runs that image.

Setup flow

Users only need to save the script, run it, then start Docker Compose.

01

Create folder

Use a clean project folder for the script, compose file, files, and database.

02

Run script

The script scans the system, installs missing tools, and builds the image.

03

Start Compose

Docker Compose starts File Browser with persistent folders and safer defaults.

Project folder
mkdir -p ~/filebrowser-autoforge
cd ~/filebrowser-autoforge

Full setup script

Save this as setup-filebrowser.sh. This is the actual script users should run before using Docker Compose.

setup-filebrowser.sh
Run it
chmod +x setup-filebrowser.sh
./setup-filebrowser.sh

Full Docker Compose setup

Save this as docker-compose.yml after the image is built. It includes persistent storage, restart policy, healthcheck, log rotation, and security hardening.

docker-compose.yml
services:
  filebrowser:
    image: ${FILEBROWSER_IMAGE:-my-filebrowser}
    container_name: ${FILEBROWSER_CONTAINER:-filebrowser}

    restart: unless-stopped
    init: true

    ports:
      - "${FILEBROWSER_PORT:-8080}:80"

    volumes:
      - type: bind
        source: ./files
        target: /srv
      - type: bind
        source: ./database
        target: /database

    security_opt:
      - no-new-privileges:true

    cap_drop:
      - ALL

    cap_add:
      - NET_BIND_SERVICE

    pids_limit: 256
    stop_grace_period: 20s

    healthcheck:
      test: ["CMD-SHELL", "wget -q --spider http://127.0.0.1:80/ || exit 1"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 20s

    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"

    networks:
      - filebrowser_net

networks:
  filebrowser_net:
    name: filebrowser_net
    driver: bridge
Start File Browser
mkdir -p files database
docker compose up -d
docker compose ps
docker compose logs -f filebrowser

Access and firewall

Open File Browser from your browser after Compose starts.

URL

Open http://SERVER-IP:8080.

Login

Default login is usually admin / admin. Change it immediately.

UFW firewall
sudo ufw allow 8080/tcp
sudo ufw reload
sudo ufw status
Cloud VPS note: also allow TCP port 8080 in Oracle/AWS/Azure/Google/Hetzner security rules.

Troubleshooting

Common problems and quick fixes.

Docker Compose says image not found

Run ./setup-filebrowser.sh first. It builds the local image named my-filebrowser.

Port 8080 does not open

Check docker compose ps, logs, Linux firewall, and VPS security rules.

Permission problem

Create folders first with mkdir -p files database. For testing only, use chmod -R 777 files database.

Need another port

Create a .env file with FILEBROWSER_PORT=8090, then restart Compose.