Skip to content

How to Deploy a Status Page to Cloudflare Pages

You need a fast, reliable, and automated status page, but you don’t want to manage the hosting infrastructure. Manually updating a status page during an incident is inefficient and error-prone.

Deploy a custom status page to Cloudflare’s global edge network using openstatus as the data source. This guide shows you how to use our Astro-based template to create a status page that automatically reflects your monitoring data.

The code for the template is available on GitHub.

Astro Status Page

First, you need an API key to fetch your monitoring data.

  1. Navigate to your openstatus dashboard.
  2. Go to SettingsAPI Token.
  3. Click Create API Key and copy the key.

Clone our status page template and install the dependencies.

Terminal window
git clone https://github.com/openstatusHQ/astro-status-page.git
cd astro-status-page
npm install

You need to specify which monitors to display on your page.

  1. Open the src/pages/index.astro file.
  2. Find the following line of code:
    const monitorIds = [1]
  3. Replace the 1 with the ID of the monitor you want to display. You can find the monitor ID in the URL when you view a monitor in the openstatus dashboard (/monitors/[ID]). You can also add multiple IDs: [1, 2, 5].

4. Configure your Cloudflare environment variable

Section titled “4. Configure your Cloudflare environment variable”

Before deploying, you must provide your openstatus API key to Cloudflare.

  1. Go to your Cloudflare dashboard and click on Workers & Pages.
  2. Select your site and go to the Settings tab.
  3. Navigate to Environment variables and add a new variable:
    • Variable name: API_KEY
    • Value: Paste your openstatus API key here.

Now you can deploy your status page.

Terminal window
npm run pages:deploy

After the command completes, your status page will be live on Cloudflare Pages. 🎉