I setup a paperless-ngx server on my mac mini but am having trouble with where it’s storing my files. It’s saving them to a default place and I have no idea where that is. I’d like to have them saved to a specific folder on my mac. I am having trouble with getting the volumes to be recognized. I did find this link from another post but I got lost when it started talking about making volumes in macos docker desktop. Here is my compose.yml:
services:
broker:
image: docker.io/library/redis:8
restart: unless-stopped
volumes:
- redisdata:/data
db:
image: docker.io/library/postgres:17
restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: paperless
POSTGRES_USER: paperless
POSTGRES_PASSWORD: paperless
webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:latest
restart: unless-stopped
depends_on:
- db
- broker
- gotenberg
- tika
ports:
- "8000:8000"
volumes:
- ./data:/usr/src/paperless/data
- ./media:/usr/src/paperless/media
- ./export:/usr/src/paperless/export
- ./consume:/usr/src/paperless/consume
env_file: docker-compose.env
environment:
PAPERLESS_REDIS: redis://broker:6379
PAPERLESS_DBHOST: db
PAPERLESS_TIKA_ENABLED: 1
PAPERLESS_TIKA_GOTENBERG_ENDPOINT: http://gotenberg:3000
PAPERLESS_TIKA_ENDPOINT: http://tika:9998
gotenberg:
image: docker.io/gotenberg/gotenberg:8.20
restart: unless-stopped
# The gotenberg chromium route is used to convert .eml files. We do not
# want to allow external content like tracking pixels or even javascript.
command:
- "gotenberg"
- "--chromium-disable-javascript=true"
- "--chromium-allow-list=file:///tmp/.*"
tika:
image: docker.io/apache/tika:latest
restart: unless-stopped
volumes:
data:
media:
pgdata:
redisdata:
The media folder is where it’s supposed to save anything I upload to my server but it’s not working. I have defined it as ./media & using the full pathname in yml file. Reading the link above, it appears that bind mounts do not work using docker desktop on macos. Any help would be appreciated on how to properly create the volume.
I didn’t notice you shared my blogpost and when the forum notified me about that, I thought it was a bug. When I realized it, I deleted my previous comment. I’m saying it just in case you were notified about that.
Have you checked if the data exists in your container? Unless data was expected to be copied automatically to the host from the container (which works only with volumes, not bind mounts), data should appear on the host, except when the target path in the container is wrong, or the data is written in the wrong fodler in the container, or when you run the docker compose command in a script or from Portainer and the actual context is not what you expect.
To be honest, I don’t know how to see if the data exists in the container, I’m not sure where it’s getting saved to. This is the default folder it’s supposed to be at:
/var/lib/docker/volumes/paperless_media/_data
but my understanding is I don’t have access to it since I am using docker desktop on macos and it’s in a linux VM.
I mostly followed your blog post up until the macos section (my apologies, I’m not a programmer and mostly only understand compose). You did post an example of a nfs share service compose but I’m not fully sure how I tie it back to my ‘media’ folder I’m trying to setup in paperless-ngx. Does this service need to be added to my paperless compose or is it a separate compose altogether?
services:
nfs-server:
image: openebs/nfs-server-alpine:0.11.0
volumes:
- /var/lib/docker/volumes:/mnt/nfs #do i change this to my folder path?
environment:
SHARED_DIRECTORY: /mnt/nfs
SYNC: sync
FILEPERMISSIONS_UID: 0
FILEPERMISSIONS_GID: 0
FILEPERMISSIONS_MODE: "0755"
privileged: true
ports:
- 127.0.0.1:2049:2049/tcp #do these ports need to line up with the paperless ports?
- 127.0.0.1:2049:2049/udp
And it looks like I make the actual directory (which I’ve already made). Then I run the chmod command to change the permissions of the folder?
sudo chmod 0700 /var/lib/docker #not sure what the 0700 means though
After that I mount the folder which makes sense. I’m just a little confused on some of the inbetween steps. I’ve added my comments to the lines I don’t fully understand. I appreciate your help and blog post. Just trying to wrap my head around it a bit more.
Please, try to read my blogpost again and give yourself time to understand it. I even shared the commands to see the volumes inside the virtual machine of Docker Desktop. And the NFS server was just an example to share the filesystem inside the virtual machine with the host, just for debugging reasons and if soneone is curious how Docker Desktop works. It is not what you need at all, but the command just before the NFS example is what you could use if you wanted to browse the /var/lib/volumes content. I would not recommend that either, because you wouldn’t want to accidentally change something there and it would not be obvious for a beginner to find the right files there.
You can run a shell in your container using docker exec or docker compose exec. And since you are using Docker Desktop, you can also go to the containers tab, click on your container and go to the “files” tab to browse the files in the container. That is also mentioned in the blogpost by the way