minikube: The "docker" driver should not be used with root privileges.

Steps to reproduce the issue:

minikube start --driver=docker
  1. Execute above command and you will see the error.

Full output of failed command:

root@fst-server-3-ubuntu-2gb-fsn1-1:~/faas-netes# minikube start --driver=docker --alsologtostderr
I0425 09:34:48.887475   24566 notify.go:125] Checking for updates...
I0425 09:34:48.999024   24566 start.go:262] hostinfo: {"hostname":"fst-server-3-ubuntu-2gb-fsn1-1","uptime":147613,"bootTime":1587652475,"procs":176,"os":"linux","platform":"ubuntu","platformFamily":"debian","platformVersion":"18.04","kernelVersion":"4.15.0-96-generic","virtualizationSystem":"","virtualizationRole":"","hostid":"0a8bb66d-63f8-47b9-b95e-6bb3ce32e001"}
I0425 09:34:48.999713   24566 start.go:272] virtualization:  
πŸ˜„  minikube v1.9.2 on Ubuntu 18.04
I0425 09:34:49.001356   24566 driver.go:245] Setting default libvirt URI to qemu:///system
✨  Using the docker driver based on user configuration
I0425 09:34:49.140369   24566 start.go:310] selected driver: docker
I0425 09:34:49.140388   24566 start.go:656] validating driver "docker" against <nil>
I0425 09:34:49.140411   24566 start.go:662] status for docker: {Installed:true Healthy:true Error:<nil> Fix: Doc:}
I0425 09:34:49.140448   24566 start.go:1100] auto setting extra-config to "kubeadm.pod-network-cidr=10.244.0.0/16".
πŸ›‘  The "docker" driver should not be used with root privileges.
πŸ’‘  If you are running minikube within a VM, consider using --driver=none:
πŸ“˜    https://minikube.sigs.k8s.io/docs/reference/drivers/none/
root@fst-server-3-ubuntu-2gb-fsn1-1:~/faas-netes# 

Full output of minikube start command used, if not already included:

root@fst-server-3-ubuntu-2gb-fsn1-1:~/faas-netes# minikube start
πŸ˜„  minikube v1.9.2 on Ubuntu 18.04
✨  Automatically selected the docker driver
πŸ›‘  The "docker" driver should not be used with root privileges.
πŸ’‘  If you are running minikube within a VM, consider using --driver=none:
πŸ“˜    https://minikube.sigs.k8s.io/docs/reference/drivers/none/
root@fst-server-3-ubuntu-2gb-fsn1-1:~/faas-netes# 

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@medyagh @afbjorklund Looks working. Thank You.

Here is the fix to make it quick.

Add new User

adduser developer
# password@7
usermod -aG sudo developer
su - developer

Login to the newly created User

su - developer
# password@7

Add User to the Docker Group

sudo groupadd docker
sudo usermod -aG docker $USER
- Re-Login or Restart the Server

Install Minicube

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
chmod +x minikube
mv ./minikube /usr/local/bin/minikube

Start minikube with Docker Driver

minikube start --driver=docker

Verify minikube Installation

docker ps

@bhushankumarl running minikube with root user is not allowed, please create a new user, and run it with that user

make sure add that user to the docker group. https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

Another way I found from Docker forums without creating any new user.

Just run the following CMD: minikube start --force --driver=docker

This worked for me in Ubuntu machine.

I just run command sudo usermod -aG docker $USER && newgrp docker on Ubuntu , and it worked. Could see more details in this document manage-docker-as-a-non-root-user

do not run the β€œminikube start” command with a root (sudo) privilege. just run without root privilege. this worked for me

Follow this command It will resolve your issue

sudo -E minikube start --driver=none

sudo minikube config set driver none

minikube start

if you use Linux Desktop OS with docker and minikube already installed, just run

sudo usermod -aG docker $USER

and restart your computer. It worked for me.

it worked for me, used above command

this okay:


[root@centos-linux-minikube ~]# useradd -u 1024 -g docker docker
[root@centos-linux-minikube ~]# passwd docker
Changing password for user docker.
New password: 
BAD PASSWORD: The password is shorter than 8 characters
Retype new password: 
passwd: all authentication tokens updated successfully.
[root@centos-linux-minikube ~]# su docker
[docker@centos-linux-minikube root]$ 
[docker@centos-linux-minikube root]$ 
[docker@centos-linux-minikube root]$ minikube start
* minikube v1.22.0 on Centos 7.9.2009 (amd64)
* Automatically selected the docker driver
* Starting control plane node minikube in cluster minikube
* Pulling base image ...
* Downloading Kubernetes v1.21.2 preload ...
    > preloaded-images-k8s-v11-v1...: 502.14 MiB / 502.14 MiB  100.00% 8.06 MiB
    > index.docker.io/kicbase/sta...: 361.09 MiB / 361.09 MiB  100.00% 710.58 K
    > index.docker.io/kicbase/sta...: 361.09 MiB / 361.09 MiB  100.00% 341.77 K
! minikube was unable to download gcr.io/k8s-minikube/kicbase:v0.0.25, but successfully downloaded kicbase/stable:v0.0.25 as a fallback image
* Creating docker container (CPUs=2, Memory=2200MB) ...
! This container is having trouble accessing https://k8s.gcr.io
* To pull new external images, you may need to configure a proxy: https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
* Preparing Kubernetes v1.21.2 on Docker 20.10.7 ...
  - Generating certificates and keys ...
  - Booting up control plane ...
  - Configuring RBAC rules ...
* Verifying Kubernetes components...
  - Using image gcr.io/k8s-minikube/storage-provisioner:v5
* Enabled addons: default-storageclass, storage-provisioner
* Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
[docker@centos-linux-minikube root]$ kubectl get po -A
NAMESPACE     NAME                               READY   STATUS    RESTARTS   AGE
kube-system   coredns-558bd4d5db-zxzht           1/1     Running   0          42s
kube-system   etcd-minikube                      1/1     Running   0          53s
kube-system   kube-apiserver-minikube            1/1     Running   0          53s
kube-system   kube-controller-manager-minikube   1/1     Running   0          53s
kube-system   kube-proxy-v8xtz                   1/1     Running   0          42s
kube-system   kube-scheduler-minikube            1/1     Running   0          57s
kube-system   storage-provisioner                1/1     Running   0          52s