Deploy to production with netlify deploy --prod (including build-before-deploy behavior)

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 be linked or specified with --site
  2. From the linked project root: netlify deploy --prod
  3. By default this runs your configured build command first, then uploads static files, functions, and edge functions, and processes config, replacing the current live production deploy
  4. If already built locally and you want to skip the build step: netlify deploy --prod --no-build --dir dist
  5. For CI/automation, pass the token and target site explicitly: netlify deploy --prod --auth "$NETLIFY_AUTH_TOKEN" --site my-project
  6. Add a message to the deploy log for traceability: netlify deploy --prod --message "Release v1.2.3"
  7. If the site's production deploys may be locked, use the safer variant that falls back to a draft instead of failing: netlify deploy --prod-if-unlocked
  8. After the command completes, the CLI prints the live production URL (your custom domain or *.netlify.app URL)
  9. Official docs: https://cli.netlify.com/commands/deploy ; https://docs.netlify.com/deploy/deploy-types/production-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
Roll back to a previous production deploy and lock/unlock publishing on Netlify (UI, restoreSiteDeploy API, lock/unlock deploy API)
netlify.com · 8 steps · unrated

Give your agent this knowledge — and 18,000+ 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