All articles
Help & Reference
Deploying Your Own Web App
Builders with a real web application (Next.js, Hono, Astro, Vite) who want it live on the internet through HQ's deploy platform.
First, a routing note. If you just want to put an HQ-generated artifact (a report, a mockup, a small page) on a link, you don't need this article: ask HQ to /deploy it and you're done. This article is for the next level up: deploying an app you built yourself, with its own build step and possibly its own server, using the hq-deploy command line tool directly.
The hq-deploy CLI#
hq-deploy is its own small tool, separate from the hq CLI and from slash commands (see Every HQ Command at a Glance for that distinction). If hq-deploy isn't set up on your computer, ask HQ to set it up for you. You can also skip the commands and ask HQ to deploy your project with /deploy.
The commands you'll use most:
| Command | What it does |
|---|---|
hq-deploy login | Sign in with your HQ account or a deploy API key (one time per machine) |
hq-deploy deploy | Build and deploy the current project |
hq-deploy logs | Show your app's logs |
hq-deploy inspect | Show your app's deployments and health |
Two more you may need, plus hq deploy list to see all your company's apps: hq-deploy link --org <your-company> connects a project to your company the first time you deploy a Next.js 15 or Hono 4 app. Note that hq deploy (with a space) only manages apps that are already deployed. Use hq-deploy to deploy.
The logs command answers the most common question builders have: "my deployed app is erroring, where are its logs?" They are captured for every app, and hq-deploy logs is how you read them.
No configuration needed. The CLI detects your framework when you deploy:
hq-deploy deployand your app comes up at a link, usually {app}.indigo-hq.com.
How your app runs#
- Static sites (Vite, static Astro, or a Next.js static export) are built, uploaded, and served from a CDN.
- Next.js apps that need a server, and Hono apps, run on HQ's servers. You don't manage a server or container. They deploy to production only, and each deploy replaces the live version.
- Remix and server-mode Astro aren't supported for new apps. Use Next.js or Hono for an app with server code.
Building a full-stack app? HQ Deploy supports Next.js 15 and Hono 4. See Deploying Full-Stack Apps: Next.js and Hono.
API keys#
hq-deploy login asks for a deploy API key. Create one with:
hq api-keys create --deployAdd --deploy-app <app-id> to limit the key to one app. Facts worth knowing about these keys:
- The full key is shown exactly once, at creation. The server keeps only a one-way hash, so nobody (including support) can recover a lost key. If you lose it, revoke it and create a new one.
- After login, the key is stored on your machine in
~/.hq-deploy/config.json, readable only by your user account. - You can list your active keys and revoke any of them at any time; listing never reveals the secret part.
Treat a deploy key like any credential: it belongs in the login prompt and nowhere else. Never paste it into a chat session or a document; the reasons are in the Secrets Guide.
Need deploys to run in your own AWS account? Email support@hqforwork.com and we'll talk it through.
Common questions#
How do I pick my app's subdomain?
It comes from your app's name. Letters are made lowercase and spaces become hyphens, so My App comes up at my-app.indigo-hq.com. A subdomain can be 3 to 63 characters, using letters, numbers, and hyphens. It can't start or end with a hyphen. If you rename it later, the old link redirects to the new one for 30 days. Each one can only be used once across HQ, and api, www, admin, app, and dashboard are reserved. Run hq deploy list to see your company's apps and their links.
How do I take an app offline?
Ask HQ to take it offline, or in the HQ console at hq.computer, open Deployments, open the app's menu, and choose Deactivate. You have 30 days to Reactivate it. After that it's deleted for good.
Can I roll back a bad release?
For a static site, yes: hq-deploy rollback --reason "<why>" puts an earlier working version back. Add --deployment <id> to pick which one. For Next.js server apps and Hono apps, deploy the previous version of your code again.
If you get stuck#
If a deploy fails, read hq-deploy logs first. For everything else, see The "I'm Stuck" Guide or file /hq-bug.