In this categoryIntegrations · 69
Chat Apps & Bots
Docs, Sheets & Email
IntegrationsBeginner

How to Deploy a Static Site from the Command Line

Build a static site and ship it to a host with a single CLI command, then verify the live URL.

9 minBeginner

Static sites are the simplest things to deploy: a build step turns your source into a folder of files, and a single command uploads that folder to a host. This guide takes a built site from your machine to a public URL using a host CLI, with a check at the end to confirm it is live.

What you need

  • A static site project with a build command
  • An account on a static host and its CLI installed
  • About 10 minutes

Step 1: Build the output folder

Run your build so the host has finished files to upload. Note the output directory; most tools use dist or build.

zsh - build
$npm run build
Built in 4.2s. Output written to dist/
$

Step 2: Authenticate the CLI

Log in once so the CLI can push on your behalf. This opens a browser and stores a token for future deploys.

terminal
# example host CLI; the flow is the same across hosts
host login
# opens a browser, then prints: logged in as you@example.com

Step 3: Deploy the folder

Point the deploy command at your output folder. The CLI uploads the files and prints the live URL when it finishes.

Terminal - deploy
$ host deploy --dir dist --prod
Uploading 38 files...
Done in 6s.
Live at https://my-site.example.app
The CLI uploads the build and returns a URL.

Step 4: Verify the live site

Open the URL and confirm a real status code rather than trusting the upload log alone. A quick request from the terminal proves the page is actually served.

terminal
curl -I https://my-site.example.app
# expect: HTTP/2 200
Deploy the build, not the source
Point the deploy at your output folder, not the project root. Shipping source files instead of the built output is the most common reason a static deploy serves a blank or broken page.

Result: your site is live at a public URL from a single command, and you confirmed it with a real request rather than just the upload message.

Watch related tutorials

Free weekly email

New guides in your inbox

Fresh step-by-step how-to guides as we publish them. One email a week, no more.

Tags
#deploy#cli#static-site#hosting#ship