Docker Volume Permissions denied

I have qbittorrent running in a Docker container on a Ubuntu 24.04 host.
The path for downloaded files is a volume mounted from the host.
When using a normal user account on the host (user), I cannot modify or delete the contents of /home/user/Downloads/torrent, it will throw a permission denied error.
If I want to modify files in this directory on the host I will need to use sudo.
how do I make it so that I can normally modify and delete the files in this path without giving everything 777?

ls -l shows the files in the directory are owned by uid=700 and gid=700 with perms 755
inside the container this is the user that runs qbittorrent
however this user does not exist outside the container

setting user directive to 1000:1000 causes the container to entirely fail to start

My docker compose file:

version: '3'
services:
    pia-qbittorrent:
        image: j4ym0/pia-qbittorrent
        container_name: pia-qbittorrent
        cap_add:
            - NET_ADMIN
        environment:
            - REGION=Japan
            - USER=redacted
            - PASSWORD=redacted
        volumes:
            - ./config:/config
            - /home/user/Downloads/torrent:/downloads
        ports:
            - "8888:8888"
        restart: unless-stopped
1 Like

Change permission to your download location with sudo chown -R $USER:$USER /home/user/Downloads/torrent . This happens when you let the container create the directory vs creating the volume location prior with mkdir /home/user/Downloads/torrent.

In your environment, add:

  • UID=1000
  • GID=1000

This is assuming that the userID that you want to use is 1000.

Let us know if that solved your issue.

1 Like

This did solve my issue, thanks