There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Learning by doing: How to change the folder in docker compose (vaultwarden)

Hi! I am running a vaultwarden-docker and would like to change the folder where the credentials are stored. This is my current docker-compose-file:

version: ‘3.4’

services:

vaultwarden:


<span style="color:#323232;">image: vaultwarden/server:latest
</span><span style="color:#323232;">
</span><span style="color:#323232;">restart: always
</span><span style="color:#323232;">
</span><span style="color:#323232;">ports:
</span><span style="color:#323232;">
</span><span style="color:#323232;">  - '127.0.0.1:8200:80'
</span><span style="color:#323232;">
</span><span style="color:#323232;">volumes:
</span><span style="color:#323232;">
</span><span style="color:#323232;">  - ./vaultwarden:/data/
</span>

So my credentials are stored in a folder called vaultwarden in the root of the server.

a) How can i change this folder in the stack-file of portainer without loosing the data?

b) Where would the folder be when i would write “vaultwarden” without the “./”? In the /root-folder?

Sorry for the noob-questions but the docker-tutorials i found are much too high for me. ;)

this_is_router ,
@this_is_router@feddit.de avatar

Just to correct a mistake: - ./vaultwarden:/data/ means that the folder /data/ of the container is in the subfolder vaultwarden inside the folder that contains the docker-compose.yml. it is not located in /. for that you need to remove the leading “.”

If you remove ./ vaultwarden points to a volume named vaultwarden that need to be defined separately:

./vaultwarden = relativ path from the docker-compose folder

/vaultwarden = absolut path /

vaultwarden = a volume called vaultwarden

moddy OP ,

This is good. there was an OLD vaultwarden-folder in my root-directory and i thought this would be the current, but you are absolutely right: The folder is in the compose-directory!

Do you really think this is a good place?

this_is_router ,
@this_is_router@feddit.de avatar

It’s more like quick and dirty. I generally try to create a volume and save the data outside the compose folder. Default is /var/lib/docker/volumes if I remember correctly.

inner ,
@inner@lemmy.l00p.org avatar

So my credentials are stored in a folder called vaultwarden in the root of the server.

that’s not true:

./vaultwarden with the ./ prefix means that vaultwarden will be in the same folder as your docker-compose.yml.

It looks as a good position for your setup.

thisNotMyName ,

That’s the good thing about containers, that’s super easy. Just stop the container, move your folder to your desired location (e.g. /home/user/vaultwarden), change the path in your compose file (stack) (i.e.: /home/user/vaultwarden:/data/), redeploy the stack and that’s it :)

MaggiWuerze ,

/thread

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines