Help Center/ CodeArts Deploy/ FAQs/ Command Execution for Deployment Actions/ Running Docker Commands/ What Should I Do If I Do Not Have the Deployment Permissions?
Updated on 2025-05-16 GMT+08:00

What Should I Do If I Do Not Have the Deployment Permissions?

Symptoms

Case 1: The error message connect: permission denied is displayed.

Case 2: An error message is displayed, indicating that the current account does not have permissions to access /etc/docker/daemon.json:.

Cause Analysis

Only the root user and users in the Docker user group are allowed to perform operations on Docker.

Solution

  1. Add the current account to the Docker user group.

    1. Log in to the server using a user account with the sudo permissions, for example, testuser.
    2. Check whether the Docker user group exists.
      sudo cat /etc/group | grep docker
      1. If so, add the current account to the Docker user group.
        sudo usermod -aG docker testuser
      2. If not, create a Docker user group and add the current account to the group.
        sudo groupadd docker
        sudo usermod -aG docker testuser

  2. Exit the server. Then, log in to the server again and check whether the current account can run the Docker command.

    docker  info

  3. If another error message, indicating that you do not have permissions to access /var/run/docker.sock, is displayed, modify the permissions for /var/run/docker.sock.

    sudo chmod a+rw /var/run/docker.sock