Skip to main content

Ensuring Containers Run at Startup

You can run a Docker container that is downloaded to your system with:

docker run --restart=always container-name-or-ID

However, to ensure that the Docker Engine service runs at startup (which is needed for containers to run), also ensure that said service is enabled. Without the Docker Engine service, specifying --restart=always is pointless. No docker containers can run without Docker Engine being active on a system, both at startup and during system usage.

On Linux distributions which rely on systemd for service management (that is, most of them), you can enable the Docker Engine service to run at startup with the following command:

sudo systemctl enable docker

If you're not using systemd... you're on your own. Read your boot/service manager's documentation on starting system services.

If Docker is installed properly and the system recognizes "docker.service" as a possible service present on the machine, your device will now run Docker Engine at startup, thus enabling your containers specified with --restart=always to run at startup too.