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
| Policy | Behavior |
|---|---|
no | Never restart automatically. Only manual start. |
always | Always restart, even after reboot. |
unless-stopped | Restart unless you manually stop the container. |
on-failure | Restart 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
- Use
unless-stoppedinstead ofalwaysfor apps you sometimes stop manually — it still survives reboots but respects your explicitdocker stop. - Define the restart policy in your Compose file (
restart: no) so adocker compose up -ddoes not silently re-enable auto-start. - After any change, verify with
docker inspectbefore rebooting the machine.
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.