Netlify
Overview
Netlify is a managed platform for building and hosting web apps, providing Git-connected continuous deployment, serverless and edge functions, and per-deploy preview URLs. It targets static sites and frontend frameworks plus their attached backend functions. Read this when you need to deploy a web app, configure redirects/headers, or drive deploys with the CLI.
Official sources
Install / setup
npm install -g netlify-cli
Core concepts
- Continuous deployment: connecting a Git repo triggers a build and deploy on each push.
- Deploy previews: pull requests/branches get isolated preview URLs before merging to production.
- Functions: serverless (and edge) functions deployed alongside the site for backend logic.
netlify.toml: project configuration for build settings, redirects, headers, and function paths.
- Redirects & rewrites: rule-based routing (including SPA fallback and proxying) defined in config or a
_redirects file.
- Environment variables: configured per site/context (production, deploy-preview, branch) and used during build and at runtime.
Best practices
- Keep build, publish directory, redirects, and headers in
netlify.toml so configuration is versioned with the code.
- For CI environments, install the CLI as a local dev dependency (
npm install netlify-cli --save-dev) rather than relying on a global install (per the docs).
- Use an SPA catch-all redirect (
/* /index.html 200) for client-side routed apps so deep links resolve.
- Scope environment variables to the correct deploy context to avoid leaking production secrets into previews.
Common pitfalls
- Missing SPA redirect → client-side routes 404 on direct navigation.
- Setting a wrong publish directory → the build succeeds but the deployed site is empty or shows the wrong root.
- Expecting functions to hold state between invocations → they are stateless and short-lived; use external storage.
Examples
# Authenticate, link the repo, and deploy to production
netlify login
netlify link
netlify deploy --prod
Further reading
Related skills
- ../vercel — comparable managed frontend hosting platform
1---2name: netlify3description: Managed hosting for web apps with Git deploys, functions, and edge; consult for deploys, redirects, env vars, and the Netlify CLI.4domain: stack5category: infra6tags: [hosting, serverless, frontend, deploy, cli, jamstack]7official_sources:8 - https://docs.netlify.com/9 - https://github.com/netlify/cli10verified: 2026-06-1611metadata:12 source: https://skillmd.com/skills/gabriel7silva/netlify13---1415# Netlify1617## Overview18Netlify is a managed platform for building and hosting web apps, providing Git-connected continuous deployment, serverless and edge functions, and per-deploy preview URLs. It targets static sites and frontend frameworks plus their attached backend functions. Read this when you need to deploy a web app, configure redirects/headers, or drive deploys with the CLI.1920## Official sources21- Docs: https://docs.netlify.com/22- Repo (CLI): https://github.com/netlify/cli23- CLI install: https://docs.netlify.com/cli/get-started/2425## Install / setup26```bash27npm install -g netlify-cli28```2930## Core concepts31- Continuous deployment: connecting a Git repo triggers a build and deploy on each push.32- Deploy previews: pull requests/branches get isolated preview URLs before merging to production.33- Functions: serverless (and edge) functions deployed alongside the site for backend logic.34- `netlify.toml`: project configuration for build settings, redirects, headers, and function paths.35- Redirects & rewrites: rule-based routing (including SPA fallback and proxying) defined in config or a `_redirects` file.36- Environment variables: configured per site/context (production, deploy-preview, branch) and used during build and at runtime.3738## Best practices39- Keep build, publish directory, redirects, and headers in `netlify.toml` so configuration is versioned with the code.40- For CI environments, install the CLI as a local dev dependency (`npm install netlify-cli --save-dev`) rather than relying on a global install (per the docs).41- Use an SPA catch-all redirect (`/* /index.html 200`) for client-side routed apps so deep links resolve.42- Scope environment variables to the correct deploy context to avoid leaking production secrets into previews.4344## Common pitfalls45- Missing SPA redirect → client-side routes 404 on direct navigation.46- Setting a wrong publish directory → the build succeeds but the deployed site is empty or shows the wrong root.47- Expecting functions to hold state between invocations → they are stateless and short-lived; use external storage.4849## Examples50```bash51# Authenticate, link the repo, and deploy to production52netlify login53netlify link54netlify deploy --prod55```5657## Further reading58- https://docs.netlify.com/routing/redirects/ — redirects and rewrites59- https://docs.netlify.com/functions/overview/ — functions overview6061## Related skills62- ../vercel — comparable managed frontend hosting platform