Deploy apps
Import a repo, configure service types, ship from git push or Promote, and go live per environment.
How deployment works
- Connect a GitHub repo to a Bytstack project (classic import or monorepo checklist).
- Configure on Service → Settings: type (fixed after create), build/start commands, root directory, build mode, path filters, and Variables.
- Deploy from Service → Overview (Deploy now), git push (auto-deploy), or
bytstack deploy— Bytstack clones, installs, builds, then publishes a container (web/worker/cron) or static assets. - Release — traffic switches to the new deployment (rolling update for web). Open Deployments → detail for the stage timeline, build output, and CLI equivalents.
Statuses: queued → cloning → building → publishing → releasing → live.
With deployment environments enabled, each environment (production, staging, …) has its own services. Use the project switcher (?environment=) so deploys and Variables target the right stage.
Service types
| Type | Use for | Build | Runtime | Public URL |
|---|---|---|---|---|
| Web | APIs, SSR (Next.js, Remix), Node servers | Optional | Container + ingress | Yes |
| Static | SPAs (Vite, CRA, Vue, Angular) | Required | CDN / object storage | Yes |
| Worker | Background jobs, queue consumers | Optional | Container (no HTTP) | No |
| Cron | Scheduled tasks | Optional | CronJob | No |
Rule of thumb: client-side SPA with npm run build → Static. Long-running Node HTTP process → Web.
Framework detection
On import, Bytstack reads the repo-root package.json and suggests defaults:
| Framework | Type | Build | Start / publish |
|---|---|---|---|
| Next.js, Nuxt, Remix | Web | npm run build | npm start |
| Express / Fastify / Nest | Web | optional | npm start |
| Vite / CRA / Vue / Angular / Gatsby / Astro (static) | Static | npm run build | dist, build, or public |
For monorepos, set Root directory to the app folder (e.g. apps/web). Optionally set path filters so only relevant changes trigger deploys.
Supported Node majors: 18, 20, 22 (default 20, or clamped from engines.node).
Configuration checklist
| Setting | Notes |
|---|---|
| Branch | Per-environment; deployed on push when auto-deploy is on; default often matches the env slug (staging) or main for production |
| Root directory | Subfolder with package.json |
| Build mode | isolated (package dir) or workspace (repo-root install + filter) — Settings → Build |
| Path filters | Globs that gate auto-deploy (empty = every push). Use Suggest workspace defaults in workspace mode — Settings → Git |
| Build command | After install; required for static |
| Start command | Web & worker containers (npm start, node dist/index.js, …) |
| Publish directory | Static output folder (Settings groups this under Static site) |
Web services must listen on 0.0.0.0 and the injected PORT. Prefer npm start / production servers over npm run dev in production.
Build machine tiers
Any Dockerfile is supported. Choose build capacity independently from your runtime service plan:
| Build machine | CPU limit | Memory limit | Build-minute rate |
|---|---|---|---|
| Standard | 2 CPU | 8 GiB | 1× |
| Performance | 4 CPU | 16 GiB | 4× |
Standard is the default and is the only build machine for static sites. Performance requires both the workspace plan and the service plan to be Starter or Pro. It may remain unavailable until the rollout is enabled for your workspace and deployment environment. A ten-minute Performance build therefore uses 40 tier-weighted build minutes.
Set the machine for the next deploy in Service → Settings → Build machine, with bytstack services update --build-machine-tier standard|performance, or with buildMachineTier in bytstack.yaml. Changing it does not alter an in-progress build.
For exit 137 or an out-of-memory message, reduce peak Docker image build memory or, when the service is eligible and the rollout is enabled, switch to Performance. Performance is an explicit cost choice; Bytstack never upgrades and retries a build automatically. See Pricing & limits.
Native dependencies
Some npm packages ship native addons (image libraries, SQLite bindings, cryptography helpers, and similar). They often need an install script during the image build to download a Linux binary or compile from source.
By default, generated Node image builds skip install scripts so installs stay fast and predictable. Turn Native dependencies on for a single service when your app needs those packages and the build fails during npm install or reports a missing binary.
When to enable
Enable it when:
- The build log points at a dependency that needs compile or prebuild steps (common examples include
sharpandbetter-sqlite3). - The same app builds locally with scripts enabled but fails on Bytstack with the setting off.
You usually do not need it when every dependency is plain JavaScript, or when you use a custom Dockerfile (you control install behavior there). Static sites do not use this path in v1.
How to turn it on
| Path | What to do |
|---|---|
| Dashboard | Service → Settings → Build — check Native dependencies, Save changes, then deploy. |
| CLI | bytstack services update --native-dependencies (or --no-native-dependencies to turn it off). Applies on the next deploy. |
| bytstack.yaml | Set nativeDependencies: true on the service. See bytstack.yaml and Blueprint. |
The setting is per service. Other services in the project can stay off.
What happens on deploy
On the next deploy, Bytstack’s generated Node Dockerfile:
- Runs install with lifecycle scripts so native packages can download or build Linux binaries.
- Adds compile tooling only in the build stage of the image. The running container stays on a slim Node base.
Caching: App-only commits usually reuse the install layer (no full recompile). Changing package.json or lockfiles re-runs install, which can take longer when native packages rebuild.
Billing: There is no new meter. You still pay Build minutes (tier-weighted) at the same unit price. Native compiles can run longer, so wall-clock time may increase — especially on the first build or after dependency changes. See Billing and Pricing & limits.
Tips
- Keep lockfiles committed so installs stay reproducible.
- Pin versions for native packages you rely on.
- If install succeeds but the build still runs out of memory, reduce peak image-build work or, when eligible, use the Performance build machine. Native compiles can spike memory during install, not at runtime.
Custom Dockerfile (BYO)
If the service uses build.dockerfilePath (BYO Dockerfile), Native dependencies does not apply — Bytstack does not modify your Dockerfile. Install build-essential, Python, or other toolchain packages in the build stage yourself, and run install with scripts enabled if your dependencies require it.
Limits and rollout
- Static services cannot enable Native dependencies in v1.
- BYO Dockerfile services cannot enable it; use your Dockerfile instead.
- The feature may remain unavailable until it is enabled for your workspace. If the toggle or API is missing, contact support — do not work around it with a broken install.
Troubleshooting
| Symptom | What to try |
|---|---|
| Install fails with a native addon error while the setting is off | Enable Native dependencies, save, redeploy. |
| Install is slow after a dependency change | Expected when lockfiles change; later deploys cache the install layer when only app code changes. |
| Build exits 137 / out-of-memory during install | Trim dependencies or parallel work; try Performance when eligible. |
| Setting is disabled greyed out | The service uses a custom Dockerfile — adjust install in that file. |
| Static site | Not supported in v1 — use a web service or BYO static build. |
Git-track vs Promote
| Path | Behavior |
|---|---|
| Git-track | Each environment watches its own branch with autoDeploy. Push to staging updates the staging column only. |
| Promote | After soak, Promote copies the image digest (or rebuilds static at the same SHA) into the next environment — not a git merge. |
When you add Staging, turn auto-deploy off on Production so accidental pushes to main do not skip soak. Details: Deployment environments.
Auto deploy
With the GitHub App installed, pushes to the configured branch for that service’s environment trigger a new deployment. Disable auto-deploy on the service for manual releases or Promote-only production.
Rollback
Open Deployments, pick a previous successful version, and roll back. No rebuild — the prior artifact stays available (within retain limits).
Logs
- Build logs — install/compile output for the deploy
- Runtime logs — live tail from web/worker/cron pods (cron: View runs opens Logs → Runtime with the run selector)
Available in the dashboard and via bytstack logs. Overview and deploy detail show Equivalent: bytstack … hints next to Deploy.
Platform pause
When the platform kill-switch is on, Service Overview shows a banner and Deploy / wake / cancel / rollback stay disabled — you are not left guessing after a failed POST.