How to deploy the openstatus probe to Cloudflare Containers
In this guide we will show you how to deploy the OpenStatus probe to Cloudflare Containers.
Cloudflare Containers is a platform that allows you to run serverless containers in the Cloudflare network.
Cloudflare containers automatically scales down after a given time. We will push a cron worker that will keep our container alive and running on Cloudflare Containers platform.
The code showcased in this guide is available on GitHub
Requirements
Section titled “Requirements”- A Cloudflare Account.
- An openstatus Account.
Create a private location on OpenStatus
Section titled “Create a private location on OpenStatus”- Go to the OpenStatus dashboard.
- Click on the
Private locationsin the sidebar. - Click on the
Create Private Locationbutton. - Give it a human readable name.
- Save token.
- Click submit to save the newly created private location.
Create a Cloudflare Container
Section titled “Create a Cloudflare Container”- Create a new cloudflare workers container template using the following command:
pnpm create cloudflare@latest --template=cloudflare/templates/containers-template- Fetch openstatus private location image from Docker Hub, we need to specify the platform to linux/amd64 because Cloudflare Containers currently only supports amd64 architecture.:
docker docker pull --platform linux/amd64 ghcr.io/openstatushq/private-location:latest- Tag the image, be aware we cannot use the
latesttag on Cloudflare Containers:
docker tag ghcr.io/openstatushq/private-location:latest openstatus-private-location:v1- Push the image to Cloudflare Container Registry:
pnpm wrangler containers push openstatus-private-location:v1- Update the
wrangler.tomlfile to use the pushed image:
[containers] image = "registry.cloudflare.com/GENERATED_ID/openstatus-private-location:cf-1"- Update the worker to use a cron trigger to keep the container alive, add the following to your
wrangler.tomlfile:
triggers = { cron = ["*/2 * * * *"] }- Update the
index.tsfile to run a simple command to keep the container alive:
sleepAfter = "150s";and
async scheduled(_controller: any, env: Env) { try { const container = getContainer(env.MY_CONTAINER); await container.start({ envVars: { OPENSTATUS_KEY: env.OPENSTATUS_KEY, }, }); } catch (e) { console.error("Error in scheduled task:", e); }
return new Response("ok");},- Add you OpenStatus API secret
pnpm wrangler secret put OPENSTATUS_KEY- Deploy the container to Cloudflare Containers:
pnpm wrangler deployConclusion
Section titled “Conclusion”You have successfully deployed the openstatus private location probe to Cloudflare Containers. Thus you can monitor your endpoint from Cloudflare’s global network.

