Skip to main content

Application config: zwrm.toml

Every ZWRM application has a zwrm.toml file in its root directory. This file is created by zwrm init and defines how your app is built, deployed, and run.

Minimal example

[app]
name = "my-app"

[build]
dockerfile = "Dockerfile"

[[services]]
internal_port = 8080

  [[services.ports]]
  port = 443
  handlers = ["http", "tls"]

Full reference

[app]

FieldTypeDefaultDescription
namestringrequiredApplication name
primary_regionstring"local"Preferred deployment region (not yet implemented)

[build]

FieldTypeDefaultDescription
dockerfilestring"Dockerfile"Path to Dockerfile
contextstring"."Build context directory
imagestringPre-built image (alternative to Dockerfile)
You can also set build arguments:
[build.args]
NODE_ENV = "production"

[deploy]

FieldTypeDefaultDescription
max_surgeint1Max extra machines during rolling deploy
health_check_timeoutstring"60s"Time to wait for health check to pass
auto_rollbackbooltrueRoll back on failed deploy
stabilization_periodstring"10s"Wait time after health check before proceeding

[env]

Set non-secret environment variables:
[env]
PORT = "8080"
NODE_ENV = "production"
For sensitive values, use zwrm secrets instead.

[[services]]

Define how traffic reaches your app:
[[services]]
internal_port = 8080
protocol = "tcp"

  [[services.ports]]
  port = 80
  handlers = ["http"]

  [[services.ports]]
  port = 443
  handlers = ["http", "tls"]

  [services.concurrency]
  type = "requests"
  hard_limit = 25
  soft_limit = 20

[services.health_check]

[services.health_check]
type = "http"
interval = "10s"
timeout = "2s"
grace_period = "30s"
method = "GET"
path = "/health"
port = 8080
failure_threshold = 3

[vm]

FieldTypeDefaultDescription
sizestring"shared-cpu-1x"VM size preset
cpusintOverride preset CPU count
memoryintOverride preset memory (MB)
kernelstringCustom kernel path
restart_policystring"on-failure"Restart policy
max_restartsint-1Max restart attempts (-1 = unlimited)
Available VM size presets:
PresetCPUsMemory
shared-cpu-1x1256 MB
shared-cpu-2x1512 MB
shared-cpu-4x21024 MB
performance-1x12048 MB
performance-2x24096 MB
performance-4x48192 MB
performance-8x816384 MB

[[volumes]]

[[volumes]]
name = "data"
size_mb = 10240
mount_point = "/data"
See Volumes for more details.

[network]

[network]
private = true

  [[network.rules]]
  source = "same_app"
  port = 8080
  protocol = "tcp"
  action = "allow"
Setting private = true enables communication between your app’s VMs over a private network.

CLI config: ~/.zwrm/config.toml

Global CLI settings are stored at ~/.zwrm/config.toml. This file is created automatically on first use.
control_plane_url = "https://zwrm.io"
dashboard_url = "https://dashboard.zwrm.eu"
default_app = ""
default_region = "local"
FieldDescription
control_plane_urlAPI endpoint for the ZWRM control plane
dashboard_urlURL for the web dashboard
default_appDefault application name if none is specified
default_regionDefault deployment region
You can override control_plane_url on any command with the --api-url flag.

Global flags

Every zwrm command accepts these flags:
FlagDescription
--config <path>Path to CLI config file (default: ~/.zwrm/config.toml)
--api-url <url>Override the control plane URL
--verbose, -vEnable verbose output