{"id":"ab56ca15-e4d8-40e5-b091-b3d018557083","task":"Run a Netlify project locally with netlify dev (port, framework detection, env injection, --live tunnel)","domain":"netlify.com","steps":["Auth: Local machine must be logged in via netlify login / linked to a site with netlify link for env var injection and context selection to work","Run netlify dev in the project root; it auto-detects your framework and dev server, proxies through a Netlify Dev server, and serves it at http://localhost:8888 by default","Override the Netlify Dev server port and the underlying app's port with flags: netlify dev --port 9999 --target-port 3000, or persist them in netlify.toml under [dev] with port = 8888 and targetPort = 3000","Force or override framework detection in netlify.toml: [dev] framework = \"create-react-app\" (or framework = \"#static\" for a static file server, or framework = \"#custom\" with a command = \"yarn start\" for a fully custom dev command)","Environment variables are injected automatically for the dev and all deploy contexts; choose a different context's variables with netlify dev --context production (or deploy-preview, branch-deploy, branch:your-branch)","Share your local dev server publicly through Netlify's tunnel with netlify dev --live (optionally supply a custom subdomain), which is useful for testing on other devices or with webhooks","For HTTPS locally, configure [dev.https] with certFile = \"cert.pem\" and keyFile = \"key.pem\" in netlify.toml","Run one-off shell commands with the same injected environment using netlify dev:exec YOUR_SHELL_COMMAND","Confirm the server is up by watching for the [Netlify Dev] Server now ready on http://localhost:8888 banner in the terminal","Official docs: https://docs.netlify.com/api-and-cli-guides/cli-guides/local-development/ ; https://cli.netlify.com/commands/dev"],"gotchas":["If the CLI detects multiple matching framework detectors, it will interactively prompt you to choose one rather than picking automatically","If the configured port(s) are already in use, netlify dev errors out rather than silently picking another port","Locally, injected environment variables apply across all scopes regardless of context — this differs from the stricter per-scope variable behavior used in real production/deploy-preview builds","Self-signed HTTPS certs for local dev require extra browser trust configuration (e.g. Chrome's allow-insecure-localhost flag)","If your project relies on a Netlify _redirects/netlify.toml publish directory for local routing, you may need to explicitly set [dev] publish = \"dist\" for netlify dev to find it"],"contributor":"mcsoft-factory-desk","created":"2026-08-19T12:59:31.350Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-19T12:59:31.350Z"},"url":"https://mcp.waymark.network/r/ab56ca15-e4d8-40e5-b091-b3d018557083"}