Deploy a Claude Code Website from the Terminal

Build and Deploy Without Leaving the Terminal

In one terminal session, Claude Code can create a website folder, test it and deploy it with the command-line tool (CLI) of your host. You keep control. Claude Code asks before it runs a shell command, and you approve each deploy.

This tutorial uses the Netlify CLI for the main steps. It also shows the equivalent commands for Cloudflare Pages and Vercel. You set up the CLI once and ask Claude for a self-contained folder (a folder that holds every file of the site). Then you deploy a draft, publish it and update the same link after feedback.

When This Workflow Fits

Use this workflow when Claude creates one of these:

  • A static website or landing page
  • A client review packet
  • A Markdown or HTML report
  • A small dashboard or a CSV-backed analysis
  • A PDF, image, or documentation folder
  • A prototype to share before a full build

If the project needs a backend server, a database, scheduled workers or user accounts, use a full application host.

1. Install the Host’s CLI and Sign In

You need a Netlify account and Node.js. The Netlify CLI guide asks for Node.js 18.14.0 or later. Install the CLI in your own terminal:

npm install -g netlify-cli

Then sign in one time:

netlify login

The login command opens a browser window. In that window, you give the CLI access to your Netlify account. Do this step yourself, before you start Claude Code. Then you, not Claude, approve the access to the account.

2. Start Claude Code in the Project Folder

Open a terminal in the folder for the site. Then start Claude Code, as the Claude Code quickstart shows:

cd your-project
claude

The first time, Claude Code asks you to sign in. In the default permission mode, Claude shows each shell command before it runs it, for example a build or a deploy. Then Claude waits for your approval. Read each command before you select Yes.

3. Ask Claude for a Self-Contained Folder

Give Claude a narrow target for the output:

Create a publishable static folder named review-site.

It should include:
- index.html
- styles.css
- README.md
- data/results.csv if structured data is useful
- docs/ for supporting notes

Make every link relative and keep every required asset inside review-site.
Do not include secrets, .env files, node_modules, or private local paths.
After creating the folder, list every file that should be published.

Some projects use a framework such as React or Astro. For such a project, ask Claude for the build command and the output folder instead. Then deploy that output folder.

4. Check the Folder Before It Leaves Your Machine

Ask Claude to make sure that the folder is ready:

Check review-site before we deploy it:
- index.html is the entry point
- every local link, image, and script resolves inside the folder
- no API keys, tokens, .env files, or private paths are present
- the data files contain nothing we should not publish
Then serve it locally and tell me the URL so I can look at it.

Open the local URL yourself. Click through every page. Look at the layout at phone width. Read the text. Claude can find problems in paths and files. But only you know if the content is right for the client.

5. Deploy a Draft From Claude Code

Ask Claude to deploy a draft first:

Deploy review-site to Netlify as a draft deploy, not production.
Use the alias client-review so the draft URL stays predictable.
Show me the command before you run it, then give me the draft URL.

Claude runs a command similar to this one:

netlify deploy --dir=review-site --alias=client-review

The first time, the CLI asks you to choose an existing Netlify project or to create a new one. Then it links the folder to that project for later deploys. By default, netlify deploy creates a draft at a unique URL. The --alias flag sets the start of the address of that draft. So deploys with the same alias give you a predictable link (deploy command reference).

Open the draft URL in a private window. Then test it on a phone.

6. Publish to Production

When the draft is right, ask Claude to publish it to production (the live site):

Deploy review-site to production on the same Netlify project.

Claude then adds the --prod flag:

netlify deploy --dir=review-site --prod

The site is now live at the main address of the project. If you added a custom domain in Netlify, the site is also live at that domain.

Give Claude the feedback. Tell it to keep the same project:

Update review-site based on this feedback:
- make the summary shorter
- add a table for the CSV findings
- include a limitations section
- improve the mobile layout

Keep the folder self-contained. Deploy a draft with the client-review alias first,
and after I approve it, deploy the same folder to production on the same project.

The folder stays linked to the same Netlify project. So each production deploy replaces the files at the same address. Clients keep the link that they already have.

Make Production Deploys Ask Every Time

If you told Claude Code to stop asking for some commands, add an ask rule for deploy commands. Do the same if you use a permission mode that runs more commands on its own. An ask rule makes Claude Code ask before every matching command. It asks even if an allow rule approves the same command (Claude Code permissions). Put this in .claude/settings.json in the project:

{
  "permissions": {
    "ask": [
      "Bash(netlify deploy *)",
      "Bash(npx wrangler pages deploy *)",
      "Bash(vercel *)"
    ]
  }
}

Restrict Access Before You Share Client Material

A Netlify draft URL is not private. Anyone who has the URL can open it. For client material, set up access control before you send the link:

On every host, remove secrets from the folder. Access control decides who gets in. But anyone who gets in can read every file that the browser loads.

Use Cloudflare Pages or Vercel Instead

The same Claude Code workflow works with other hosts. Only the commands change.

Cloudflare Pages uses Wrangler (Direct Upload docs). These three commands sign in, create the project and deploy the folder:

npx wrangler login
npx wrangler pages project create review-site
npx wrangler pages deploy review-site --project-name=review-site

For a preview deployment instead of production, add --branch=client-review to the deploy command. Wrangler accepts up to 20,000 files per deployment.

Vercel uses the Vercel CLI (vercel deploy reference). For a preview deployment, run vercel from the project folder. For production, run vercel --prod. The first deployment of a new project is always a production deployment, even without --prod. If the content is private, first set a team default for Deployment Protection. Then new projects start with protection.

Final Checklist

Before you send the link, make sure that these statements are true:

  • You installed the host CLI, and you signed in yourself.
  • Claude produced a self-contained folder, and you reviewed it locally.
  • The first deploy was a draft, and you tested it in a private window.
  • You set access control before you sent client material.
  • Deploy commands ask for approval every time.
  • Each revision goes to the same project, so the link stays the same.

A docs portal with Ask AI
and support tickets

Connect a repository, or describe your product to start. Each docs site has search, Ask AI, an API console, an MCP server and support tickets.

  • Publishes from GitHub on every push
  • Works with Mintlify repositories
  • API console from your OpenAPI file
  • MCP server and llms.txt for AI agents
  • Ask AI and support tickets
  • Analytics for people and AI agents
Start Free Questions? Ask AI in our docs

No card required.

Share:
Markdown version

Related Articles

↧
Loading PDF…