Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to permanently run dockerd

Tags:

linux

docker

unix

Usually before doing the standard docker process like this:

docker pull epgg/eg
docker run -p 80:80 --name eg -it epgg/eg bash

You need to run sudo dockerd at the background (i.e. with terminal open).

How can I permanently run that at the background without terminal open?

like image 587
scamander Avatar asked Nov 02 '25 17:11

scamander


1 Answers

No, better not run the docker daemon like that: sudo dockerd.

Depending on your Linux distribution you can use the following commands:

  • For running docker at startup:

    sudo chkconfig docker on
    
  • For starting docker service:

    sudo service docker start
    

These commands would work on RHEL/CentOS 6, Debian/Ubuntu.

If systemd is available on your Linux installation (for example on RHEL/CentOS 7), you could also use the following commands:

  • For running docker at startup:

    sudo systemctl enable docker
    
  • For starting docker service:

    sudo systemctl start docker
    
like image 156
Ciprian Stoica Avatar answered Nov 04 '25 09:11

Ciprian Stoica



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!