Migrating a kopia server to docker

I am currently starting manually my kopia server on my RaspberryPi like this:

kopia server --ui --insecure  --htpasswd-file=/home/pi/.config/kopia/htpasswd --address=http://raspberrypi:51515 --config-file=/home/pi/.config/kopia/repository.config --server-username=kopia &

Now, I’d like to move to the docker version of kopia, so I copied all my kopia config in my docker folder under ./config and tried to start a docker compose file like this:

      image: kopia/kopia:latest
      container_name: Kopia
      hostname: raspberrypi
      domainname: "***"
      user: "0:0"
      restart: "unless-stopped"
      privileged: true
        - SYS_ADMIN
        - apparmor:unconfined
        - /dev/fuse:/dev/fuse:rwm
        - server
        - start
        - --disable-csrf-token-checks
        - --address=
        - --server-username=kopia
        - --htpasswd-file=/app/config/htpasswd
        - --ui
        - --insecure
        - ./sharedtmp:/tmp:shared
        - ./config:/app/config
        - ./cache:/app/cache
        - ./logs:/app/logs
        - ./config:/app/rclone
        - /:/app/backup:ro
        - KOPIA_PASSWORD=***************
        - TZ=Europe/Paris

with KOPIA_PASSWORD containing what was previously stored in ./config/repository.config.kopia-password
But when starting the container, I get errors like this:

ERROR unable to initialize repository: unable to initialize repository: error opening repository: unable to open repository: unable to create format manager: invalid repository password

What should I put in KOPIA_PASSWORD ???

I am not familiar with what would get stored in “repository.config.kopia-password”, but you’ll want to make sure it is your unecrypted password.

The other thing that I am not following with your example is where your backup repository is located. You will want to make sure that your config correctly points to the repository from within the docker.

The last thing you’ll want to think about is who the owner of the repository is. I had my server running in docker for about a month before I realized that the server wasn’t using the same username and hostname as I had originally setup, which meant that maintenance wasn’t running on the repository. You’ll want to use the “–override-username” and “–override-hostname” options.

Hi, thanks for your answer @doolbneerg
It looks like you’re right: I did put the encrypted value instead of the unencrypted one in the variable. Now, I don’t have this password error anymore.
I get a timeout on rclone when starting (my repo is on pCloud through rclone), so I will try to get one step further