qBittorrent Docker container keeps restarting: “Permission denied” + “Another instance is already running”

I’m running qBittorrent in Docker routed through Gluetun. qBittorrent keeps restarting/exiting immediately.

Setup
  • Docker Compose

  • qbittorrent uses network_mode: service:gluetun

  • qBittorrent image: ghcr.io/home-operations/qbittorrent:5.1.1

  • qBittorrent config volume: /mnt/speed/config/qbittorrent/config:/config

  • qBittorrent environment:

    • PUID=568

    • PGID=568

    • TZ=Australia/Perth

    • QBT_WEBUI_PORT=30024

    • QBT_TORRENTING_PORT=51413

Logs

2026-01-14 16:24:13.172007+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:13.230859+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:13.231348+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:13.231623+00:00(N) 2026-01-15T00:24:13 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:13.231668+00:00(N) 2026-01-15T00:24:13 - Using config directory: /config/qBittorrent
2026-01-14 16:24:13.231682+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:13.531889+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:13.782071+00:00(N) 2026-01-15T00:24:13 - qBittorrent termination initiated
2026-01-14 16:24:13.785066+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:13.785077+00:00(N) 2026-01-15T00:24:13 - qBittorrent is now ready to exit
2026-01-14 16:24:14.171980+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:14.229874+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:14.230257+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:14.230516+00:00(N) 2026-01-15T00:24:14 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:14.230552+00:00(N) 2026-01-15T00:24:14 - Using config directory: /config/qBittorrent
2026-01-14 16:24:14.230569+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:14.530645+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:14.781239+00:00(N) 2026-01-15T00:24:14 - qBittorrent termination initiated
2026-01-14 16:24:14.781389+00:00(N) 2026-01-15T00:24:14 - qBittorrent is now ready to exit
2026-01-14 16:24:14.781439+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:19.380416+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:19.438824+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:19.439260+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:19.439503+00:00(N) 2026-01-15T00:24:19 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:19.439532+00:00(N) 2026-01-15T00:24:19 - Using config directory: /config/qBittorrent
2026-01-14 16:24:19.439557+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:19.739615+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:19.989958+00:00(N) 2026-01-15T00:24:19 - qBittorrent termination initiated
2026-01-14 16:24:19.990386+00:00(N) 2026-01-15T00:24:19 - qBittorrent is now ready to exit
2026-01-14 16:24:19.990421+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:24.473028+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:24.531904+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:24.532234+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:24.532473+00:00(N) 2026-01-15T00:24:24 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:24.532508+00:00(N) 2026-01-15T00:24:24 - Using config directory: /config/qBittorrent
2026-01-14 16:24:24.532525+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:24.832773+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:25.083179+00:00(N) 2026-01-15T00:24:25 - qBittorrent termination initiated
2026-01-14 16:24:25.083221+00:00(N) 2026-01-15T00:24:25 - qBittorrent is now ready to exit
2026-01-14 16:24:25.083270+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:29.600607+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:29.658217+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:29.658605+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:29.658839+00:00(N) 2026-01-15T00:24:29 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:29.658880+00:00(N) 2026-01-15T00:24:29 - Using config directory: /config/qBittorrent
2026-01-14 16:24:29.658910+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:29.958962+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:30.209501+00:00(N) 2026-01-15T00:24:30 - qBittorrent termination initiated
2026-01-14 16:24:30.209734+00:00(N) 2026-01-15T00:24:30 - qBittorrent is now ready to exit
2026-01-14 16:24:30.209764+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:34.747859+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:34.809453+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:34.809844+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:34.810067+00:00(N) 2026-01-15T00:24:34 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:34.810101+00:00(N) 2026-01-15T00:24:34 - Using config directory: /config/qBittorrent
2026-01-14 16:24:34.810119+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:35.110540+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:35.360796+00:00(N) 2026-01-15T00:24:35 - qBittorrent termination initiated
2026-01-14 16:24:35.361280+00:00(N) 2026-01-15T00:24:35 - qBittorrent is now ready to exit
2026-01-14 16:24:35.361326+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:38.688643+00:00ln: failed to create symbolic link ‘/config/qBittorrent/logs/qbittorrent.log’: Permission denied
2026-01-14 16:24:38.745520+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:38.745913+00:00QFile::at: Cannot set file position 0
2026-01-14 16:24:38.746171+00:00(N) 2026-01-15T00:24:38 - qBittorrent v5.1.1 started. Process ID: 7
2026-01-14 16:24:38.746206+00:00(N) 2026-01-15T00:24:38 - Using config directory: /config/qBittorrent
2026-01-14 16:24:38.746235+00:00Another qBittorrent instance is already running.
2026-01-14 16:24:39.046337+00:00QtLockedFile::lock(): file is not opened
2026-01-14 16:24:39.297075+00:00(N) 2026-01-15T00:24:39 - qBittorrent termination initiated
2026-01-14 16:24:39.297493+00:00(N) 2026-01-15T00:24:39 - qBittorrent is now ready to exit
2026-01-14 16:24:39.297531+00:00QtLockedFile::lock(): file is not opened

I downgraded qBittorrent to v5.1.1, deleted any lock files in the config folder, and restarted the container, but it still keeps restarting. The logs show Permission denied when creating /config/qBittorrent/logs/qbittorrent.log, then “Another qBittorrent instance is already running” and it exits. What’s the correct fix for this? I’m guessing it’s either bad permissions/ownership on the config directory, or a lock file qBittorrent can’t clear because it can’t write to the config path.

Looks like a permission issue.

ln: failed to create symbolic link ... Permission denied
It can’t write inside /config/qBittorrent/logs/.

QtLockedFile::lock(): file is not opened + Another qBittorrent instance is already running.
qBittorrent uses a lock file in the config dir. If it can’t open/create/lock it, it interprets that as “someone else has it locked”.

I would make the host directory writable by the UID/GID you’re running as (568:568)

sudo chown -R 568:568 /mnt/speed/config/qbittorrent/config

Then delete any potential lock files if there are any with:
sudo find /mnt/speed/config/qbittorrent/config -iname “lock” -o -iname “*.lck” -delete

Try restarting your container after.

If still having issues then your NFS Dataset you have mounted may have too restrictive of an ACL applied, so your chown won’t work.

ls -ldn /mnt/speed/config/qbittorrent/config
ls -ldn /mnt/speed/config/qbittorrent/config/qBittorrent

You are wanting to see that owner/group matches your 568/568 you set earlier.

That should help you narrow it a little closer.

  • Damon1974