Fresh Install: Where is .silverbullet.db.json?

My Setup

I have a fresh install of silverbullet via docker compose:

# docker-compose.yml

services:
  silverbullet:
    image: zefhemel/silverbullet:v2
    restart: unless-stopped
    userns_mode: host  # I have userns remapping enabled
    user: "1000:1000"  # in my Docker Daemon 
    volumes:
      - ${HOME}/notes:/space
    labels:
      traefik.http.services.silverbullet.loadbalancer.server.port: 3000
      # ...and other traefik config

My ~/notes directory is not empty, but I removed all silverbullet-generated files there (both v1 and v2) before spinning up the container:

$ docker compose down silverbullet
$ rm -rf ~/notes/.silverbullet*
$ rm -rf ~/notes/index.md
$ rm -rf ~/notes/SETTINGS.md
$ rm -rf ~/notes/CONFIG.md
$ docker compose up -d silverbullet

The Problem

The logs reference the creation of a .silverbullet.db.json file, but no such file exists in the container or the host filesystem:

$ docker logs -f silverbullet
silverbullet  | Storing database in /space/.silverbullet.db.json.
silverbullet  | Starting SilverBullet binding to 0.0.0.0:3000
silverbullet  | Using local disk as a storage backend: /space
silverbullet  | Listening on http://0.0.0.0:3000/ (http://localhost:3000/)
silverbullet  | SilverBullet is now running: http://localhost:3000
... <TRUNCATED>

$ docker exec -it silverbullet ls /space/.silverbullet.db.json
ls: cannot access '/space/.silverbullet.db.json': No such file or directory

$ ls ~/notes/.silverbullet.db.json
"/home/rlue/notes/.silverbullet.db.json": No such file or directory (os error 2)

What’s going on here? I also tried this with a volume mount to a totally empty directory, and observed the same thing.

The .silverbullet.db.json’s function is to cache some auth related information, if you don’t use it likely this file isn’t even created. In v1 there was a server side DB. In v2 this is no longer a thing.

I see, so the log statement indicates the “DB”'s configured location, but does not indicate that the file is actually being created. Thanks for your speedy reply and for an amazing, amazing utility. I look forward to getting fully set up with it!

1 Like