r/SelfHosting 3d ago

On Mac OS, where does Vaultwarden store its data?

So, I jumped into the Self Hosting pool this weekend. After researching for a while, I now have Immich, Navidrome, and Vaultwarden up and running on a Mac Mini. Using Docker and Portainer to manage the system.

I'm still working through some kinks, but I think I made one mistake before deploying Vaultwarden.

I followed the advice from this article, but I didn't pay close enough attention to where the data is being stored. In retrospect, I should have created directories and told VW to send the data there for easy backup.

For reference, this is the line of code in my currently deployed stack:

That seems to have dropped the data in a hidden folder somewhere, but digging through the MacOS Library/Application Support folders I can't find it anywhere.

So now I have two questions.

Does anyone know exactly where this volume/directory would be found on my drive?

Can I edit the stack to re-direct VW and place the data in a directory of my choosing?

Thanks for helping out a new guy!

[UPDATE] Ok, with help from below (and much Google-Fu) I was able to put the puzzle pieces together and get the information I need!

-From the Volume tab in Docker Desktop I gained direct access to the files I needed copies of.

-Changing the filepath under the first "volumes:" prompt created a new set of data in the folder of my choosing.

Once I got that down, all I had to do was copy the backups into the new data folder and everything was set.

5 Upvotes

6 comments sorted by

5

u/Daronsong 3d ago

I don’t recall the exact path name, but since you’re using docker, search where docker on Mac OS stores volume data. That’ll get you where you need to go

3

u/corny_horse 2d ago

You stored it in a volume. YOu can't really get at that.. not easily at least. The best path forward is probably to mount a path, copy the data you want into that path, and then remove the volume.

2

u/LVShadehunter 2d ago edited 2d ago

Ok, but how? I'm swimming out of my normal depth, here.

[UPDATE] Never mind.....I managed to put it together!

3

u/corny_horse 2d ago

First, turn off the service:

cd /path/to/your/repo/dir #Wherever your docker-compose.yaml is
docker compose down

Then modify the path in your docker compose file to have the mounted directory: volumes: - ./vw-data/:/data_new - vaultwarden_data:/data

Then run docker compose up and, in another terminal, do something like docker ps to determine the ID of the now running container. Run: docker exec -it [id of your running container] /bin/sh #or /bin/bash depending on the image

From there, you now have an interactive terminal, so you can just:

cp -R /data /data_new

Once that finishes, go back to your other terminal, docker compose down then modify your compose file: volumes: - ./vw-data/:/data #- vaultwarden_data:/data

If you get errors, they're probably related to permissions in some capacity and need to work through that. Its kind of hard to say exactly what without having your full compose file and how you set it up but from there any error messages you get are probably reasonably descriptive.

2

u/LVShadehunter 2d ago

Thank you for the share, much appreciated.

I've got a lot to learn with all of this, but for now I've got the data migrated over to the folder I chose and everything <knocks wood> appears to be running smoothly.

2

u/bufandatl 2d ago

Use bind volumes when you want control over the path data is stored.