Skip to content

How to Self-Host openstatus

You want to run openstatus on your own infrastructure instead of using the hosted service. This gives you full control over your data, customization options, and the ability to monitor internal services not accessible from the public internet.

openstatus provides a Docker Compose setup that makes self-hosting straightforward. This guide walks you through deploying all necessary services and configuring your self-hosted instance.

  • Docker and Docker Compose installed
  • Basic understanding of Docker and containerization
  • Command line experience
  • Git installed
  • Node.js and pnpm (for database migrations)

Self-hosting openstatus currently has these constraints:

  • It only works with private locations. You have to deploy our probes to the cloud provider of your choice.

This guide is divided into three parts: launching the services, setting up the database and analytics, and configuring the application through the UI.

  1. Clone the Repository

    Get the latest version of openstatus:

    Terminal window
    git clone https://github.com/openstatushq/openstatus
    cd openstatus
  2. Configure Your Environment

    Copy the example environment file. This file will hold all your configuration variables.

    Terminal window
    cp .env.docker.example .env.docker

    Open .env.docker in a text editor. At a minimum, you must set a value for AUTH_SECRET for authentication to work. For a complete setup, review the file for other variables like OAuth providers or email services.

  3. Build and Start Services

    Use Docker Compose to build and run all openstatus services in the background.

    Terminal window
    export DOCKER_BUILDKIT=1
    docker compose up -d

    You can check the status of the services with docker compose ps. It might take a few minutes for all services to be healthy.

  1. Run Database Migrations

    The database container starts with an empty database. You must run migrations to set up the required schema.

    Terminal window
    # Make sure you are in the root of the openstatus project
    cd packages/db
    pnpm install
    pnpm migrate
    cd ../.. # Return to the project root
  2. Deploy Local Tinybird Analytics

    Tinybird is used for analytics. Deploy the local datasources, pipes, and endpoints.

    Terminal window
    # Make sure you are in the root of the openstatus project
    cd packages/tinybird
    pnpm install
    tb --local deploy
    cd ../.. # Return to the project root
  3. Configure Tinybird API Key

    You need to get your local Tinybird admin token and add it to your environment file.

    Terminal window
    cd packages/tinybird
    tb --local open # This opens the Tinybird UI in your browser

    In the Tinybird UI, find and copy your admin token. Then, add it to your .env.docker file in the root of the project:

    TINY_BIRD_API_KEY="your-tinybird-admin-token"

    After adding the token, restart your services for the changes to take effect:

    Terminal window
    # Make sure you are in the root of the openstatus project
    docker compose restart

Now that the services are running, you can access the dashboard and perform the final setup steps.

  • Dashboard: http://localhost:3002
  • Status Pages: http://localhost:3003
  1. Create a Workspace and Set Limits

    • Navigate to the dashboard at http://localhost:3002.
    • Sign up and create a new workspace.
    • Because this is a self-hosted instance, you need to manually set the feature limits for your workspace directly in the database.

    The following command updates the limits for the workspace with id = 1. If your workspace has a different ID, change the WHERE id = 1 part of the command.

    Terminal window
    curl -X POST http://localhost:8080/ -H "Content-Type: application/json" \
    -d '{"statements":["UPDATE workspace SET limits = '\''{\\"monitors\\":100,\\"periodicity\\":[\\"30s\\",\\"1m\\",\\"5m\\",\\"10m\\",\\"30m\\",\\"1h\\"],\\"multi-region\\":true,\\"data-retention\\":\\"24 months\\",\\"status-pages\\":20,\\"maintenance\\":true,\\"status-subscribers\\":true,\\"custom-domain\\":true,\\"password-protection\\":true,\\"white-label\\":true,\\"notifications\\":true,\\"sms\\":true,\\"pagerduty\\":true,\\"notification-channels\\":50,\\"members\\":\\"Unlimited\\",\\"audit-log\\":true,\\"private-locations\\":true}'\'' WHERE id = 1"]}'

    You can find your workspace ID by inspecting the database with a command like curl -X POST http://localhost:8080/ -H "Content-Type: application/json" -d '{"statements":["SELECT id, name FROM workspace"]}'.

  2. Deploy a Private Location

    The self-hosted version relies on private locations to perform checks.

    • In the dashboard, navigate to Settings -> Private Locations and create a new one.
    • Copy the generated OPENSTATUS_KEY.
    • Deploy the private location probe to your infrastructure using the Docker image ghcr.io/openstatushq/private-location:latest.
    • When deploying, you must provide two environment variables to the container:
      • OPENSTATUS_KEY: The key you just copied.
      • OPENSTATUS_INGEST_URL: The URL of your self-hosted server’s API endpoint (e.g., http://<your-server-ip-or-domain>:3001).
    • For a detailed guide on deploying a private location, see Deploy Private Locations on Cloudflare Containers.
  3. Create Monitors

    You’re all set! You can now create monitors in the dashboard. They will be checked by the private location you deployed.

openstatus running locally with self-hosted services

openstatus consists of multiple services running together:

ServicePortPurpose
workflows3000Background jobs and scheduled tasks
server3001API backend (tRPC)
dashboard3002Admin interface for configuration
status-page3003Public status pages
private-location8081Monitoring agent for checks
libsql8080Database (HTTP)
libsql5001Database (gRPC)
tinybird-local7181Analytics and metrics

Congratulations! You’ve successfully:

  • ✅ Deployed openstatus on your own infrastructure
  • ✅ Configured all required services
  • ✅ Set up a private location for monitoring
  • ✅ Created your first self-hosted monitor

Containers won’t start: Check Docker logs with docker compose logs [service-name]

Database migrations fail: Ensure you’re in the correct directory and have pnpm installed

Private location not connecting: Verify the OPENSTATUS_KEY and OPENSTATUS_INGEST_URL are correct

Tinybird issues: Make sure the Tinybird token is correctly set in .env.docker