Google CloudMid
Cloud Run: container failed to start and listen on PORT
Cloud Run needs your container to listen on the PORT variable on 0.0.0.0. Fix the bind address and port, test the image locally and read the logs.
What you see
Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable.
What it means
Cloud Run starts your container and expects it to listen on a port it provides in the PORT environment variable. If the container does not start listening in time, the revision fails.
How to confirm the cause
- 1Run the same image locally first
docker run -p 8080:8080 -e PORT=8080 IMAGE
Google's advice: if it fails locally, fix it locally before you deploy.
- 2Read the container's logs
gcloud run services logs read SERVICE_NAME --region REGION
The docs point to Cloud Logging for stdout and stderr, and to Error Reporting for crashes.
Causes and fixes
Wrong port
- HOW TO TELL
- The app listens on a fixed port that is not the value of
PORT. - FIX
- Read
PORTfrom the environment and listen on it.
Bound to 127.0.0.1
- HOW TO TELL
- The server listens only on localhost.
- FIX
- Listen on all interfaces,
0.0.0.0. Binding to127.0.0.1fails.
Wrong architecture
- HOW TO TELL
- The image was built on an ARM machine and misbehaves.
- FIX
- The image must target 64-bit Linux. Build it with Cloud Build instead of on an ARM laptop.
How to stop it coming back
- Read
PORTand bind0.0.0.0in every service template. - Build images in CI, not on developer machines.
Keep going
- Runbook: Cloud Run HTTP 403: not authenticated or forbidden
- Runbook: Cloud Run 429 and 503: no instance available or instance limit reached
- Cheat sheet: gcloud
- Cheat sheet: Docker
- Lesson: the containers topic in Learn
Sources
Google Cloud documentation (docs.cloud.google.com), read 18 Nov 2026.