Starting as a Service
When using CommandBox on a staging or production server, you may wish to start up servers as a service when the OS comes online. The recommended approach is to use the CommandBox Service Manager Module, which is a commercial module that handles all major operating systems (Linux, Mac, Windows) automatically.
CommandBox Service Manager
See screencast here:
CommandBox Service Manager
Alternatively, you can manually do so following one of these community guides.

Windows

MacOS

Coming soon...

CentOS/RHEL/Ubuntu (system.d)

Create a .service file
1
nano /usr/lib/systemd/system/mySite.service
Copied!
as follows:
1
[Unit]
2
Description=mySite Service
3
4
[Service]
5
ExecStart=/usr/bin/box server start /var/www/mySiteAPI/server.json
6
Type=forking
7
8
[Install]
9
WantedBy=multi-user.target
Copied!
Start the service
1
systemctl start mySite.service
Copied!
Give the service about a minute to load up, then check its status
1
systemctl status mySite.service
Copied!
Once you've verified the service is running as expected, enable the service to load at boot
1
systemctl enable mySite.service
Copied!
Last modified 5mo ago