Production Deployment
If your NocoBase app is already running correctly on the server, production rollout usually only needs two more steps:
- Make sure the app starts automatically after the machine restarts
- Put a reverse proxy in front of the app for stable external access
In the NocoBase CLI, the main commands are:
nb app autostartnb env proxy
This page gives the overall path first. For Nginx or Caddy details, continue to the corresponding subpages.
Step 1: Enable App Autostart
In production, the first priority is not the domain name. The first priority is making sure the service can recover reliably after a reboot, container recreation, or routine maintenance.
In the CLI, nb app autostart is a command group. The most commonly used commands are:
nb app autostart enablenb app autostart listnb app autostart run
Enable autostart for the current env:
If you want to target a different env explicitly:
Then check which envs are marked for autostart:
After the system boots, run the following command to start every env that has autostart enabled:
If you want the underlying startup output for troubleshooting:
nb app autostart enable marks a CLI-managed env as allowed to start automatically.
nb app autostart run is the command that actually starts all envs that were marked for autostart.
In other words, in a real production setup you usually still need to wire nb app autostart run into your own system startup flow, such as systemd, a container platform startup script, or another host-level boot mechanism you already use.
Scope
nb app autostart only applies to envs with a CLI-managed runtime on the current machine:
localdocker
If the env is only a remote API connection, or the app is not managed locally by the CLI on this machine, these commands are not the right tool for autostart.
Step 2: Configure a Reverse Proxy
Once the app can recover automatically, the next step is to handle the external entry point. In production, the reverse proxy usually takes care of:
- binding the domain name or public port
- forwarding HTTP and WebSocket traffic to NocoBase
- handling HTTPS, certificates, caching, or access control
In the NocoBase CLI, the recommended entry points are:
nb env proxy nginxnb env proxy caddy
Default Approach
If your app is already saved as a CLI env and is a local or docker env, letting the CLI generate the proxy config is usually enough:
If the current env is already the target env, you can omit --env:
The CLI helps cover details that are easy to miss in handwritten configs, such as:
- WebSocket forwarding
- entry and static asset paths for subpath deployments
- SPA fallback pages
- provider shared config files
When To Choose Nginx Or Caddy
You can usually decide like this:
If you change env settings that affect the proxy result, such as app-port or app-public-path, remember to rerun the corresponding proxy subcommand.
Recommended Rollout Path
If you want the simplest production path, this order usually works well:
- Make sure the app can already start correctly on the server itself
- Run
nb app autostart enable - Add
nb app autostart runto your system startup process - Choose Nginx or Caddy and run the matching
nb env proxysubcommand - Verify external access through the final domain or public entry address

