Blog

Brad Wood

January 29, 2018

Spread the word


Share your thoughts

A common question we get now is how to take a CommandBox server and wrap it in a Windows service so it starts automatically at boot time.  This is ideal for production use or just a dev site that you always want to stay running.  With this new screencast, you will learn how to take any CommandBox server and install it as a Windows service using a free tool called NSSM.

https://nssm.cc/

 

Add Your Comment

(6)

Dec 06, 2018 06:31:32 UTC

by Mark Drew

This is great! very handy! But as it's console, where does the startup log go (in case you need to debug it's start?)

Dec 06, 2018 08:21:26 UTC

by Brad Wood

Hi Mark, the console logs still go the same place they always do. You can view them with "server log" as well as looking at the log file on disk. If you need to debug a server, I recommend just running the start command manually in a terminal to debug it. NSSM also has a logging setting you can enable that will capture ALL the output of CommandBox including any output of the "server start" command itself prior to the actual server process coming online.

Sep 13, 2021 15:36:57 UTC

by Tom

Normally when I run CommandBox, the server context resides under my user profile. When CommandBox runs as a service, does this change the server context? I need to import the password file. I'm having an issue with cfconfig at the moment (you are also helping me via FaceBook Group ColdFusion Programmers at the moment) so until I can get that resolved, I'm setting up the admin manually.

Sep 13, 2021 15:56:52 UTC

by Bradley D Wood

Tom, unless otherwise configured, CommandBox will extract itself into the user home dir. When you run it as a Windows service, it will use the home directory of the Windows System account by default (unless you configure another user for it to run as) which is buried inside your windows/system32 folder. This will give you a totally separate installation of CommandBox with different settings, modules, etc. I recommend you "pin" your server home with a "commandbox.properties" file as described in the docs here: https://commandbox.ortusbooks.com/setup/installation

Nov 18, 2021 10:01:30 UTC

by Marco

Thanks for this post. One question: Isn't it possible to use some setting in the config files to keep a specific commandbox started server alive?

Nov 18, 2021 15:26:46 UTC

by Brad Wood

Marco, NSSM will actually auto-start service by default I think. It's configurable on one of the tabs I didn't show. I actually recommend you look into this CommandBox module that we made after this screencast was produced. It automatically creates the services for you with a single command and works on Windows, Linux, and Mac. https://commandbox-service-manager.ortusbooks.com/ It is a paid module ($49)

Recent Entries

BoxLang 1.0.0 Beta 7 Launched

BoxLang 1.0.0 Beta 7 Launched

We are pleased to announce the release of BoxLang 1.0.0-Beta 7! This latest beta version includes improvements and essential bug fixes, but more importantly it certifies the execution of ColdBox HMVC and TestBox.

What is BoxLang?

BoxLang is a modern dynamic JVM language that can be deployed on multiple runtimes: operating system (Windows/Mac/*nix/Embedded), web server, lambda, iOS, android, web assembly, and more. BoxLang combines many features from different progr

Luis Majano
Luis Majano
July 26, 2024
New BoxLang Feature: Java Method References and Higher-Order Functions

New BoxLang Feature: Java Method References and Higher-Order Functions

We’ve added more goodies to our BoxLang Java interop: method references and higher-order functions. CFML has never let you do these things, making Java Interop feel like a second-class citizen. But with BoxLang, we’re elevating Java integration to a new level.

Maria Jose Herrera
Maria Jose Herrera
July 26, 2024
Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Level Up Your ColdFusion Skills with our Virtual Live Training: ColdBox from Zero to Hero

Are you a CFML developer looking to take your skills to the next level? Look no further than the ColdBox from Zero to Hero Virtual Live Training! This intensive two-day course will equip you with the knowledge and expertise to build robust and scalable applications using ColdBox 7, the latest version of the most popular CFML MVC framework.

What You'll Learn:

  • Master the Fun...

Cristobal Escobar
Cristobal Escobar
July 24, 2024