filebrowser: docker-compose don't save Usernames and Passwords

Description I want to create a docker-compose Application. The container should automatically restart the container with the new image via Watchtower when an update has come out. The container also restarts, it only does not keep the login data and always uses the admin/admin login data after a restart. The user data is not persistent. New users are also deleted.

Expected behaviour I want to have the login data persistent.

What is happening instead? No Error Message. Filebrowser don’t write any data in the filebrowser.db But the File is mapped to the container

Additional context Server: Debian 11 Docker and Docker-Compose latest Versions

How to reproduce?

  1. Create the docker-compose file
version: '3.1'

networks:
  traefik:
    external: true
  mdb:
    external: true

services:
 filebrowser:
  container_name: filebrowser
  image: filebrowser/filebrowser:latest
  volumes:
    - ./file-data:/srv
    - ./filebrowser.db:/database/filebrowser.db
    - ./settings.json:/config/settings.json
  networks:
    - traefik
    - mdb
  restart: always
  labels:
    - "traefik.enable=true"
    - "traefik.http.routers.manuals.entrypoints=http"
    - "traefik.http.routers.manuals.rule=Host(`manuals.DOMAIN`)"
    - "traefik.http.middlewares.manuals-https-redirect.redirectscheme.scheme=https"
    - "traefik.http.routers.manuals.middlewares=manuals-https-redirect"
    - "traefik.http.routers.manuals-secure.entrypoints=https"
    - "traefik.http.routers.manuals-secure.rule=Host(`manuals.DOMAIN`)"
    - "traefik.http.routers.manuals-secure.tls=true"
    - "traefik.http.routers.manuals-secure.tls.certresolver=http"
    - "traefik.http.routers.manuals-secure.service=manuals"
    - "traefik.http.services.manuals.loadbalancer.server.port=80"
    - "traefik.docker.network=traefik"
    - "traefik.http.routers.manuals-secure.middlewares=secHeaders@file"
  1. Create the settings.json
{
  "port": 80,
  "baseURL": "",
  "address": "",
  "log": "stdout",
  "database": "/database/filebrowser.db",
  "root": "/srv"
}

Create the filebrowser.db touch filebrowser.db

Start the docker container docker-compose up -d

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (1 by maintainers)

Most upvoted comments

Anyone found a solution to this yet?

As already documented in this issue, setting a bind to an existing config json is quite enough:

docker-compose.yml:

user: 1000:1000
environment:
  FB_CONFIG: "/filebrowser.json"
  FB_DATABASE: "/database/filebrowser.db"
volumes:
  - {PathOrVolumeToFileBrowserRoot}:/srv
  - {PathToFileBrowserRoot}/filebrowser.db:/database/filebrowser.db
  - {PathToFileBrowserRoot}/filebrowser.json:/filebrowser.json

filebrowser.json:

{
  "port": 80,
  "baseURL": "",
  "address": "",
  "log": "stdout",
  "database": "/database/filebrowser.db",
  "root": "/srv"
}

It’s been almost a year but I am struggling to fix this issue. With these settings, every time I recreate the container, the login credentials default to admin/admin. And the filebrowser.db in the bind folder does not get updated at all.

Anyone found a solution to this yet?

As already documented in this issue, setting a bind to an existing config json is quite enough:

docker-compose.yml:

user: 1000:1000
environment:
  FB_CONFIG: "/filebrowser.json"
  FB_DATABASE: "/database/filebrowser.db"
volumes:
  - {PathOrVolumeToFileBrowserRoot}:/srv
  - {PathToFileBrowserRoot}/filebrowser.db:/database/filebrowser.db
  - {PathToFileBrowserRoot}/filebrowser.json:/filebrowser.json

filebrowser.json:

{
  "port": 80,
  "baseURL": "",
  "address": "",
  "log": "stdout",
  "database": "/database/filebrowser.db",
  "root": "/srv"
}