anvil start to execute the production bundle generated by anvil build. The command spawns the bundle as a child Node.js process, inheriting stdio so logs appear in your terminal or platform’s log drain. This is the command you call in Dockerfile CMD entries, process manager configs, and deploy scripts.
Usage
Flags
Path to the bundle produced by
anvil build. If the file does not exist, anvil start prints an error and exits with code 1 — it will not attempt to build it automatically.Override the HTTP port. When provided, this value is forwarded to the child process as the
PORT environment variable, taking precedence over any PORT already set in the environment. When omitted, the bundle falls back to PORT from the environment, then to 3000.Port resolution order
The port used by the running server follows this precedence, from highest to lowest:--port <port>flag passed toanvil startPORTenvironment variable already set in the shell- Default value of
3000hardcoded in the generated bundle entry point
Example: basic deploy script
A typical deploy pipeline builds the project then starts it:Example: custom port
Example: custom bundle path
Example: using PORT from the environment
Example: Docker
Error: bundle not found
If you runanvil start before anvil build, you will see: