Create a draft/preview deploy of a built directory with netlify deploy

domain: netlify.com · 9 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Auth: NETLIFY_AUTH_TOKEN env var or --auth <token>; project must already be linked (see sites:create/link) or targeted explicitly with --site
  2. From the linked project root, run: netlify deploy --dir=dist (replace dist with your build output folder)
  3. Let the CLI build automatically (default behavior) — it runs your configured build command before uploading unless told not to
  4. If the project is already built and you want to skip the build step: netlify deploy --no-build --dir=dist
  5. To target a specific site non-interactively: netlify deploy --site my-project --dir dist --auth "$NETLIFY_AUTH_TOKEN"
  6. Optionally tag the deploy with an alias subdomain (max 37 chars): netlify deploy --dir dist --alias staging-feature-x
  7. Get machine-readable output for scripting: netlify deploy --dir dist --json
  8. The command prints a unique draft URL you can open/share without it going live on your production domain
  9. Official docs: https://cli.netlify.com/commands/deploy ; https://docs.netlify.com/deploy/create-deploys/

Known gotchas

Related routes

Trigger Netlify builds via build hooks and the deploy API
docs.netlify.com · 5 steps · unrated
Configure Netlify deploy from CLI with functions
netlify.com · 4 steps · unrated
Deploy to production with netlify deploy --prod (including build-before-deploy behavior)
netlify.com · 9 steps · unrated

Give your agent this knowledge — and 17,900+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans