Running a Server
Start, inspect, open and stop an embedded server from your project folder.
CommandBox starts an embedded web server from any folder. In this lesson you will start one, check on it, open it in a browser and stop it.
Start it
Run this from your web root.
box server start
CommandBox downloads what it needs the first time and picks a free port if you do not set one. The server uses the default engine unless you pick one, see below.
Manage it
box server status
box server list
box server open
box server stop
box server forget
statusshows the server for the current folder, with its URL.listshows every server CommandBox knows about.openopens it in your browser.stopshuts it down.forgetremoves the saved record of a stopped server.
Each folder gets its own server, so several projects can run side by side on different ports.
Choose a port
box server start port=8080
Choose the engine
Use cfengine to pick a different engine. It can name a CFML engine, with an optional version after an @, or point to a WAR.
box server start cfengine=adobe@2023
box server start WARPath=/path/to/app.war
Omit cfengine to use the default engine. To run BoxLang, set cfengine=boxlang.
Recap
box server startruns an embedded server for the current folder, using the default engine unless you choose one.status,list,open,stopandforgetmanage the servers you have started.- Use
port=to fix the port andcfengine=(orWARPath=) to change what runs.