How to Disable Auto-Start for a Docker Container

When a Docker container (like Airbyte) keeps starting automatically after a machine reboot, it usually has a restart policy set to always or unless-stopped. Docker reads that policy at boot and brings the container back up — even if you stopped it manually before shutting down. This guide shows how to check the policy and change it so the container stays off until you start it yourself.

Steps to Disable Auto-Start

1. Check the Container's Restart Policy

Run the following command to inspect the restart policy of the container:

docker inspect -f '{{ .HostConfig.RestartPolicy.Name }}' <container-name>

Example:

docker inspect -f '{{ .HostConfig.RestartPolicy.Name }}' airbyte-abctl-control-plane

The output is the policy name — always, unless-stopped, on-failure or no. If it is not no, that is why the container keeps coming back.

2. Update the Container to Not Auto-Restart

Run this command to disable the auto-restart policy:

docker update --restart=no <container-name>

Example:

docker update --restart=no airbyte-abctl-control-plane

This prevents the container from starting automatically after reboot. It applies immediately — no need to recreate the container.

3. Verify the Change

Run the inspect command again — the policy should now be no:

docker inspect -f '{{ .HostConfig.RestartPolicy.Name }}' airbyte-abctl-control-plane
no

4. (Optional) Stop the Container Manually

If the container is still running and you want to stop it now, use:

docker stop <container-name>

Example:

docker stop airbyte-abctl-control-plane

Quick Summary of Docker Restart Policies

PolicyBehavior
noNever restart automatically. Only manual start.
alwaysAlways restart, even after reboot.
unless-stoppedRestart unless you manually stop the container.
on-failureRestart only if the container exits with a non-zero status.

Common Problems

Problem 1: the container still starts after reboot

Cause: the policy was changed on the wrong container, or the container was recreated by a compose file that sets the restart policy again.

Solution: verify the name with docker ps -a (see docker ps explained), and if you use Docker Compose, remove the restart: line from the compose file and re-run docker compose up -d.

Problem 2: docker update is not supported for this container

Cause: some containers (e.g. managed by a separate orchestrator tool) block updates, or you lack permission.

Solution: run with sudo, or edit the container's policy in the orchestrator's config (for Airbyte's abctl, this happens via its own management commands).

Best Practices

Conclusion

We checked the container's restart policy with docker inspect, disabled it with docker update --restart=no, and verified the change. The key idea: Docker's restart policy decides what happens after reboot, so that single setting — not a manual stop — is what controls auto-start.

Related Articles

A.M. Rinas

Written by A.M. Rinas

Full-Stack Software Engineer working on web applications, DevOps automation, and databases. More about me on the about page, or say hi through the contact page and LinkedIn.

← Back to all articles