File Browser

Introduction

File Browser is an open-source, self-hosted file browser.

The Docker Compose File

---
version: "3.8"

services:
  overseerr:
    image: hurlenko/filebrowser:latest
    container_name: filebrowser
    hostname: filebrowser
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    env_file:
      - .env
    environment:
      - TZ=${TZ}
      - PUID=${PUID}
      - PGID=${PGID}
      - FB_PORT=${FB_PORT}
    volumes:
      - /opt/filebrowser/config/filebrowser.db:/config/filebrowser.db
      - /:/data
      - /etc/localtime:/etc/localtime:ro
    labels:
      - com.centurylinklabs.watchtower.enable=true

docker-compose.yml

The Docker Environment Variables File

TZ=Europe/Stockholm
PUID=1000
PGID=1000
FB_PORT=6060

.env

This Docker Compose file defines a single service named “filebrowser”. The service is built from the “hurlenko/filebrowser:latest” Docker image, which is the latest version available. The container name is set to “filebrowser” as well.

The “restart” section ensures that the container will always be restarted if it exits (unless manually stopped). This is useful for ensuring that the service is always available, especially if it crashes or is shut down unexpectedly.

The “security_opt” section prevents your container processes from gaining additional privileges. This is an important security consideration.

By default, File Browser runs on port 8080, but you can change it if necessary. I have utilised an available environment variable "FB_PORT" to set the listen port to 6060.

The “volumes” section maps the “filebrowser.db” database inside the container to a local directory on the host machine. This allows us to persist data across container restarts. File Browser stores all its configuration and monitoring data in this file, so it’s important to keep it intact. I have also mapped the root of my server to the data directory inside the container.

The "labels" section allows the Watchtower service to keep this container update automatically.

Remember to create all folders and files before trying to launch your docker-compose.

Running Filebrowser with Docker Compose

To run File Browser with Docker Compose, first, make sure you have Docker and Docker Compose installed on your machine. Then, create a new directory for your project and save the above Docker Compose file as “docker-compose.yml” in that directory.

Next, run the following command from the same directory:

docker compose up -d

This command will start the File Browser container in the background and detach from it. You can then access the File Browser web interface by going to http://localhost:8080 in your web browser.

Conclusion

In this article, we explored how to set up and run the File Browser software using Docker Compose. We looked at the different sections of the Docker Compose file and explained how they work together to create a functional File Browser service. By running File Browser with Docker Compose, you can easily deploy and manage the tool on your own server, without having to worry about dependencies or configuration.


Welcome - File Browser