Restarting (1) Docker Origin: Platform & cloud Last updated 13 Oct 2026

Docker container keeps restarting (Restarting (1) x seconds ago)

The container crashes on start and its restart policy (always/unless-stopped/on-failure) starts it again in a loop.

Exact message you may see Restarting (1)container keeps restartingRestarting (137)restart loop
Seen on: Docker

Meaning

docker ps shows Restarting (exit code) and the restart count climbs. The cause is whatever makes the main process exit: missing env vars, DB not reachable yet, bad config, port conflict inside the container, or OOM.

Common causes

  • App crashes on startup (config, env, missing file)
  • Dependency (database) not ready
  • Out of memory (exit 137)
  • Wrong command/entrypoint

⚡ Quick fix

  1. Read logs: docker logs --tail 100 c
  2. Check exit code and OOMKilled in docker inspect
  3. Temporarily set restart: "no" and run interactively

Detailed fix by platform

Docker

  1. bash
    docker inspect -f '{{.State.ExitCode}} OOM={{.State.OOMKilled}} restarts={{.RestartCount}}' web
    docker logs --tail 100 web

How to diagnose

  1. Exit code — 1 app error, 127 command, 137 OOM
  2. Logs — Error before each restart
  3. Dependencies — Is the DB up?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):

500.30 — HTTP Error 500.30 - ASP.NET Core app failed to start (.NET)500.3057P03 — FATAL: the database system is starting up (PostgreSQL)57P03ACR unauthorized — Azure Container Registry: unauthorized: authentication required, visit https://aka.ms/acr/authorization (AKS ErrImagePull 401) (Azure)ACR unauthorizedConflict container name — Conflict. The container name "/x" is already in use by container … (Docker)Conflict container na…Container failed to start — Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable (Google Cloud / Firebase)Container failed to s…CrashLoopBackOff — Kubernetes: CrashLoopBackOff (Kubernetes)CrashLoopBackOffExceptionInInitializerError — java.lang.ExceptionInInitializerError (Java)ExceptionInInitialize…Exited (0) — Docker container exits immediately (Exited (0) / Exited (1) right after start) (Docker)Exited (0)Restartin…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.