Quick answer
What this guide helps you do
Diagnose Docker services that stay stopped or fail after an Ubuntu reboot by checking the daemon, restart policies, mounts, dependencies, ports and logs.
Check the host first
systemctl --failed
df -hT
findmnt
ip -brief address
ip route
resolvectl status
Then check Docker with systemctl status docker, docker ps -a and docker compose ls. An exited container differs from a missing container or a daemon that never started.
Check Docker boot state
sudo systemctl is-enabled docker
sudo systemctl is-active docker
sudo journalctl -u docker -b --no-pager -n 150
If disabled on a normal Docker host, enable it. If it crashed, diagnose the first relevant error rather than repeatedly restarting it.
Inspect restart policies
sudo docker inspect YOUR_CONTAINER --format '{{.HostConfig.RestartPolicy.Name}}'
Compose example:
services:
app:
restart: unless-stopped
Apply changes with docker compose up -d. Docker recommends restart policies rather than a second process manager controlling the same container.
Prove storage mounted
findmnt /srv/media
findmnt /srv/appdata
df -hT /srv/media /srv/appdata
If an expected drive is absent, stop affected services. Otherwise a bind mount may point at an empty root-filesystem directory.
Read exit evidence
sudo docker inspect YOUR_CONTAINER --format 'status={{.State.Status}} exit={{.State.ExitCode}} error={{.State.Error}}'
sudo docker logs --timestamps --tail=150 YOUR_CONTAINER
sudo ss -lntup
Permission denied, address conflicts, unavailable databases, DNS failures and full filesystems need different fixes. Use evidence before editing.
Make recovery durable
Correct mount-by-UUID configuration, narrow permissions, the intended restart policy and any health-aware dependency. Start one project at a time, test the application, then perform a controlled second reboot.
Verification checklist
- Docker is enabled and active.
- Networking and DNS work.
- Required filesystems are mounted.
- Disk space is available.
- Restart policies are intentional.
- Exit codes and logs were reviewed.
- Application health was tested.
- A second reboot succeeds.
These checks are a diagnosis path, not a claim that every image behaves identically.
Next: How to Update Docker Containers Safely. Start with How to Install Docker on Ubuntu Server.
Official references: Start containers automatically and Compose startup order.