Skip to content

Rootless Docker

Warning

Deprecated. Docker access for regular users is being removed by default at the end of September 2026 (from 2026-09-30). Use Apptainer instead. This page is kept for reference, and for users who have been granted an explicit exception.

πŸ“² Install rootless docker

Please run the following commands:

  1. curl -sSL https://get.docker.com/rootless | sh
  2. Follow the instructions showed after the command

    a. open the .bashrc file or .zshrc file. (depends on your shell)

    b. Add the following two environmental variables to the end of the .*rc file.

    export PATH=/home/$USER/bin:$PATH
    export DOCKER_HOST=unix:///run/user/$UID/docker.sock
    

    c. source the rc file

    source ~/.bashrc
    # or
    # source ~/.zshrc
    
  3. Start rootless docker

    systemctl --user start docker
    
  4. Test if docker was installed

    docker run hello-world
    
  5. Install docker compose plugin (optional)

    DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
    mkdir -p $DOCKER_CONFIG/cli-plugins
    curl -SL https://github.com/docker/compose/releases/download/v2.34.0/docker-compose-linux-x86_64 -o $DOCKER_CONFIG/cli-plugins/docker-compose
    
    chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
    
    docker compose version
    

πŸ—‘οΈ Uninstall rootless docker

rm -rf ~/.local/share/docker
cd ~/bin
rm -f *docker* *containerd* *runc* *rootlesskit* *vpnkit*