Why am I getting a Deploy Error: Health Checks?

When I deploy a new application on the App Platform, I see the Building… progress indicator but after a while it errors out and I see this:

Deploy Error: Health Checks
Your deploy failed because your container did not respond to health checks.
Error code: DeployContainerHealthChecksFailed
Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

In general, when App Platform attempts to deploy your application it will run some automated health checks to make sure your app started correctly before sending web traffic to it. You can configure these checks, but by default they’re just checking to see if your app is listening on port 8080.

So the most common reason for this error, especially with a new app, is a misconfigured port.

App Platform expects that any Service you deploy will listen on all interfaces on port 8080 ( If you cannot modify your Service’s code to listen on port 8080, you can configure App Platform to expect a different port. This can be done during initial App creation or on the Component details page of your Service after your App has been created. If you’re configuring your application via App Spec, you can use the http_port key to set App Platform to expect your Service on a different port.

For convenience, App Platform will set an environment variable named PORT in your runtime environment that contains the expected port number for your Service to listen on.

This comment has been deleted

Had the same issue while using Nuxt.js and deploying as an app. I added this to nuxt.config.js:

server: {
  port: process.env.PORT,
  host: process.env.HOST

Leaving the default HTTP port in DigitalOcean, but adding an env var in the component configuration HOST= This lets me work locally via .env and on DigitalOcean without hardcoding anything.