How to fix Incus Error: You don't have the needed permissions to talk to the incus daemon

Problem

When you try to run an incus command such as

incus_permission_fix.sh
incus image list

you see an error message such as

example.txt
Error: You don't have the needed permissions to talk to the incus daemon (socket path: /var/lib/incus/unix.socket)

or

example.txt
Error: Get "http://unix.socket/1.0": dial unix /var/lib/incus/unix.socket: connect: permission denied

Solution 1: Preferred:

Add your user to the incus-admin group:

example.sh
sudo usermod -aG incus-admin $USER

You need to log out and back in for the group change to take effect.

Solution 2: Workaround:

Run the command as root:

example.sh
sudo incus image list

This works since the root user has access to the incus daemon by default.


Check out similar posts by category: Incus, Container