3

I'm trying to install Linkwarden and I want to make sure I get the storage right so that if I have to move the data to another VM, it is easy to do. If I use the default compose file, will it simply create a ./data ./pgdata and ./meili_data folders in the same folder where the docker compose file is? Which of course is very handy as then I have the compose, the .env and the data all in one place. Is this a good way of managing docker volumes? The install docs here say that I can also set a STORAGE_FOLDER variable in the .env file which by default is /data. But does this mean that the default is in the root directory of the host?

top 2 comments
sorted by: hot top controversial new old
[-] ArchAengelus@lemmy.dbzer0.com 1 points 1 week ago

Docker compose files (and docker execs) use the following format

  volumes:
    - <host_storage_path>:<vm_mount_path>

If the docker-compose has a ${VAR_NAME}:/data, then it will replace it directly with the variable defined in the .env file in the same directory with the format

VAR_NAME=/path/on/host

And would mount the host’s /path/on/host to /data

[-] rtxn@lemmy.world 0 points 1 week ago* (last edited 1 week ago)

I've never used Linkwarden, but the /data folder is often used by Docker containers to store the application's data, so it's likely an internal path. You'll have to create a volume that exposes the internal /data path to the host filesystem, then whatever is written into that directory will be made available to both the container and the host system. Any file or directory in the container can be exposed this way.

I usually put my data volumes in /srv (where my large RAID array is mounted) and config volumes in /config, into a subdirectory named after the service, and with the minimal necessary privileges to run the container and the service. You could, for example, create volumes like this:

/srv/linkwarden/postgres_data:/var/lib/postgresql/data
/srv/linkwarden/linkwarden_data:/data/data
/srv/linkwarden/meili_data:/meili_data

The volume path (left side of the colon) can be anything. The right side is where the services expect their files to appear inside the container.

this post was submitted on 11 Oct 2025
3 points (100.0% liked)

Selfhosted

52344 readers
112 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS