···1414- [Export Metrics to your OTLP endpoint](/guides/how-to-export-metrics-to-otlp-endpoint)
1515- [How to Add an SVG Status Badge to your GitHub README](/guides/how-to-add-svg-status-badge)
1616- [How to use React Status Widget](/guides/how-to-use-react-widget)
1717+- [How to deploy private location on Cloudflare Containers](/guides/how-to-deploy-probes-cloudflare-containers)
···11+---
22+title: How to deploy the openstatus probe to Cloudflare Containers
33+description: Learn how to use OpenStatus monitoring data and deploy your own Status Page to cloudflare pages.
44+sidebar:
55+ label: Deploy private probes on Cloudflare Containers
66+---
77+import { Image } from 'astro:assets';
88+import log from '../../../assets/guides/how-to-deploy-probes-cf-containters/cloudflare-log.png';
99+import os from '../../../assets/guides/how-to-deploy-probes-cf-containters/private-location.jpg';
1010+1111+1212+In this guide we will show you how to deploy the OpenStatus probe to Cloudflare Containers.
1313+1414+Cloudflare Containers is a platform that allows you to run serverless containers in the Cloudflare network.
1515+1616+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.
1717+1818+The code showcased in this guide is available on [GitHub](https://github.com/openstatusHQ/private-location-cloudflare-container)
1919+2020+### Requirements
2121+- A Cloudflare Account.
2222+- An [openstatus](https://www.openstatus.dev) Account.
2323+2424+2525+2626+### Create a private location on OpenStatus
2727+2828+1. Go to the OpenStatus dashboard.
2929+2. Click on the `Private locations` in the sidebar.
3030+3. Click on the `Create Private Location` button.
3131+4. Give it a human readable name.
3232+5. Save token.
3333+6. Click submit to save the newly created private location.
3434+3535+### Create a Cloudflare Container
3636+3737+1. Create a new cloudflare workers container template using the following command:
3838+3939+```bash
4040+pnpm create cloudflare@latest --template=cloudflare/templates/containers-template
4141+```
4242+4343+2. 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.:
4444+4545+```bash
4646+docker docker pull --platform linux/amd64 ghcr.io/openstatushq/private-location:latest
4747+```
4848+4949+3. Tag the image, be aware we cannot use the `latest` tag on Cloudflare Containers:
5050+5151+```bash
5252+docker tag ghcr.io/openstatushq/private-location:latest openstatus-private-location:v1
5353+```
5454+5555+4. Push the image to Cloudflare Container Registry:
5656+5757+```bash
5858+pnpm wrangler containers push openstatus-private-location:v1
5959+```
6060+6161+5. Update the `wrangler.toml` file to use the pushed image:
6262+6363+```toml
6464+[containers]
6565+ image = "registry.cloudflare.com/GENERATED_ID/openstatus-private-location:cf-1"
6666+```
6767+6868+6. Update the worker to use a cron trigger to keep the container alive, add the following to your `wrangler.toml` file:
6969+7070+```toml
7171+triggers = { cron = ["*/2 * * * *"] }
7272+```
7373+7474+7. Update the `index.ts` file to run a simple command to keep the container alive:
7575+7676+```ts
7777+sleepAfter = "150s";
7878+```
7979+and
8080+8181+```ts
8282+async scheduled(_controller: any, env: Env) {
8383+ try {
8484+ const container = getContainer(env.MY_CONTAINER);
8585+ await container.start({
8686+ envVars: {
8787+ OPENSTATUS_KEY: env.OPENSTATUS_KEY,
8888+ },
8989+ });
9090+ } catch (e) {
9191+ console.error("Error in scheduled task:", e);
9292+ }
9393+9494+ return new Response("ok");
9595+},
9696+```
9797+9898+9. Add you OpenStatus API secret
9999+100100+```bash
101101+pnpm wrangler secret put OPENSTATUS_KEY
102102+```
103103+104104+105105+10. Deploy the container to Cloudflare Containers:
106106+107107+```bash
108108+pnpm wrangler deploy
109109+```
110110+111111+112112+113113+114114+## Conclusion
115115+116116+You have successfully deployed the openstatus private location probe to Cloudflare Containers. Thus you can monitor your endpoint from Cloudflare's global network.
117117+118118+119119+ <Image
120120+ src={log}
121121+ alt="OpenStatus Private Location on Cloudflare Containers"
122122+ caption="Cloudflare Workers Logs showing OpenStatus Private Location running"
123123+ />
124124+125125+ <Image
126126+ src={os}
127127+ alt="OpenStatus Private Location on Cloudflare Containers"
128128+ />