Custom start command
A custom start command replaces the framework's default runtime command for one environment. It is optional and available for all frameworks, including Next.js, Nuxt, and Other. It does not replace the build command.
Configure a command
Enter your command in Custom start command under Advanced options:
- Project creation: the Source & Deploy step.
- Adding an environment: the Basics step.
- Existing environment: open Settings, expand Advanced options, and edit the Custom start command (optional) field.
- The field is blank by default. Leaving it blank uses the framework default.
- Each environment has its own value. A new environment does not automatically copy Production's command.
- Only organization Owners and Admins can edit the command. Members can view it.
- A command entered during creation is saved before the first deployment, including when a paid project is activated.
Command requirements
Enter a single-line shell command. Shell operators such as && are supported. The command must start a server that listens on port 3000 on all network interfaces (0.0.0.0), not only localhost.
Use a command appropriate for your application's build output and runtime. See Astro static sites for a static-output example.
Apply or clear a command
Saving updates the configuration without starting a new build. A failed environment may automatically retry its existing image after a save, but that image still uses its old command.
To apply the changed command, explicitly trigger a new build/deployment from the environment's Deployments tab.
The command is baked into the deployment image during the build. Restarting an existing deployment is not enough to apply a changed command.
To restore the framework default, clear the field, save, and trigger a new build/deployment. The currently running deployment keeps its previous command until the new deployment takes over.