Horizon

Getting started

Install the Horizon CLI, sign in and share localhost on a public HTTPS URL in three commands.

Put your local server on a public HTTPS URL that anyone, or any webhook, can reach.

Paste this prompt into your coding agent to set up Horizon for you.
Set up a Horizon tunnel for this project. Horizon (https://hrzn.run) puts a local server on a public HTTPS URL. Docs: https://hrzn.run/docs

1. Check whether the Horizon CLI is installed: run "hrzn --version". If it is missing, install it globally with this project's package manager, for example "npm install -g @hrzn/cli".
2. Ask me for my Horizon account ID. It is shown on https://hrzn.run/dashboard. Then run "hrzn login <account-id>". It prints an "Authorize at" link. Show me the link and wait while I approve it in the browser. It prints "Successfully authorized" when it is done.
3. Find the port my dev server runs on, from the package.json scripts or the framework config. Start the dev server if it is not running.
4. Ask me for a subdomain, and suggest the project folder name in lowercase. Run "hrzn tunnel http://localhost:<port> -s <subdomain>" and keep it running in the background.
5. When the terminal prints "HORIZON: Tunnel connected", tell me my public URL: https://<subdomain>.hrzn.run
6. If I want to test webhooks from Stripe, GitHub, Shopify, Slack, Twilio or Clerk, follow the matching guide at https://hrzn.run/docs/guides/webhooks/<service>

Before you begin

  • Node.js with npm, pnpm, Yarn or Bun
  • A server running on your machine, for example on http://localhost:3000
  • A free Horizon account. Sign in at hrzn.run with GitHub or Google.

Install the CLI

Install @hrzn/cli globally. It adds the hrzn command.

npm install -g @hrzn/cli

Sign in

Your dashboard shows the login command with your account ID filled in. Copy it and run it.

hrzn login <account-id>

Start a tunnel

Point the tunnel at your local server. Include the protocol and the port.

hrzn tunnel http://localhost:3000 -s my-app

Your app is now live at https://my-app.hrzn.run. Pick your own name after -s.

Check it works

Open https://my-app.hrzn.run in a browser, or on your phone. The terminal prints HORIZON: Tunnel connected, then one line per request:

  GET | [200] | /

Press Ctrl+C to stop the tunnel.

Pick a subdomain or get a random one

Use -s. Without it, Horizon picks a random subdomain that changes every time you restart. That's fine for a quick share. It breaks anything you configured with the old URL, like a webhook endpoint.

Reserve a subdomain to keep it yours across restarts. Reserved subdomains are a paid feature, see Pricing.

Next steps

On this page