How to Set Up and Manage Health Checks
Validated on 21 May 2025 • Last edited on 27 May 2025
App Platform is a Platform-as-a-Service (PaaS) offering that allows developers to publish code directly to DigitalOcean servers without worrying about the underlying infrastructure.
Health checks in App Platform serve as readiness probes to determine when an application is ready to start handling traffic. When you a deploy an app, App Platform uses a set of parameters to determine when health checks should begin, how often they should run, and how many times they must fail before considering the app unhealthy and sending an email to the account’s email address.
App Platform has default health check settings that work for most apps, but you can customize them for your specific app’s needs. For example, if you know your app takes longer to deploy than the default time before health checks start, you may want to increase that value.
To customize your app’s health check settings, edit the app’s spec and add the health_check
object to your service component, like this:
app.yaml
health_check:
initial_delay_seconds: 30
period_seconds: 10
timeout_seconds: 5
success_threshold: 1
failure_threshold: 5
http_path: /api
port: 8080
Each field in the health_check
object has the following meaning:
initial_delay_seconds
: The number of seconds before the App Platform begins initiating health checks after a deployment.period_seconds
: The number of seconds (interval) between health checks.timeout_seconds
: The number of seconds before a health check is considered failed.success_threshold
: The number of consecutive successful health checks required before the app is considered healthy.failure_threshold
: The number of consecutive failed health checks required before the app is considered unhealthy.http_path
: The HTTP path on which to perform health checks. If not set, App Platform disables the HTTP health check and a TCP health check used instead.port
: The port on which to perform health checks. If not set, App Platform performs the health check on the component’shttp_port
.
Once you add the health_check
object to your app spec, upload the spec to your app’s repo or deploy it directly using the control panel.
Set Up Liveness Probes
In public preview, you can enable liveness probes for services and workers that automatically restart your app if its health check fails.
We recommend using liveness_health_check
(which restarts the app) in conjunction with health_check
(which stops traffic).
Services
To enable liveness probes for a service, specify liveness_health_check
in your app spec, like this:
name: sample-golang
services:
- name: web
github:
repo: digitalocean/sample-golang
branch: master
liveness_health_check:
initial_delay_seconds: 10
period_seconds: 10
timeout_seconds: 5
success_threshold: 1
failure_threshold: 6
http_path: /
port: 8080
Workers
To enable liveness probes on workers, specify liveness_health_check
in your app spec and ensure your worker application is listening to the designated port and responds to health checks, like this:
ame: sample-golang
workers:
- name: background-service
envs:
- key: PORT
value: "8080"
github:
repo: digitalocean/sample-golang
branch: master
liveness_health_check:
initial_delay_seconds: 10
period_seconds: 10
timeout_seconds: 5
success_threshold: 1
failure_threshold: 5
http_path: /
port: 8080