Skip to main content

Filebrowser


Filebrowser - Easy File Management with Docker



version: '3'
services:
  filebrowser:
    image: filebrowser/filebrowser:s6
    container_name: filebrowser
    volumes:
      - /home:/srv #Change to match your directory
      - /home/techdox/docker/filebrowser/filebrowser.db:/database/filebrowser.db #Change to match your directory
      - /home/techdox/docker/filebrowser/settings.json:/config/settings.json #Change to match your directory
    environment:
      - PUID=$(id -u)
      - PGID=$(id -g)
    ports:
      - 8095:80 #Change the port if needed

Explanation:

This Docker Compose file sets up the Filebrowser service using the specified Docker image. It ensures that the service restarts automatically in case of failures. Port 8095 on the host is mapped to port 80 inside the container, allowing you to access Filebrowser's web interface.

The use of Docker volumes ensures that data and configuration for Filebrowser are stored persistently, even if the container is recreated or updated.

Image: This specifies the Docker image to use for the Filebrowser service. In this case, it uses the "filebrowser/filebrowser:s6" image.

Container Name: Sets the name of the Docker container to "filebrowser." This is useful for referencing and managing the container.

Volumes:

  • /home:/srv: Mounts the host's "/home" directory to "/srv" inside the container.
  • /home/techdox/docker/filebrowser/filebrowser.db:/database/filebrowser.db: Mounts the Filebrowser database file for persistent storage.
  • /home/techdox/docker/filebrowser/settings.json:/config/settings.json: Mounts the Filebrowser settings file for configuration.

Environment:

  • PUID=$(id -u): Specifies the user ID for the container.
  • PGID=$(id -g): Specifies the group ID for the container.

Ports: Maps port 8095 on the host to port 80 inside the container, allowing access to Filebrowser's web interface.

Deploying the Compose:

docker-compose up -d

You can run this command in the directory where your Docker Compose file (containing the Filebrowser service definition) is located. It will start the Filebrowser service as a detached background process. Ensure you have Docker and Docker Compose installed on your system before running this command.