June 3, 2022
CLI Installation of ColdFusion for lower memory use
Comments
(1)
June 3, 2022
CLI Installation of ColdFusion for lower memory use
ColdFusion developer for 20+ years, professional experience in 10 other languages & frameworks. Artist, nerd, Jeep enthusiast.
Newbie 35 posts
Followers: 26 people
(1)

One of the key feature updates of CF2021 was the addition of modularity to the server. No longer were you limited to just installing the “whole kit and caboodle”, now you could pick and choose your connectors and packages, allowing you a leaner installation. You could, of course, use the GUI installer to get everything in place, then remove the things you didn’t need. But the other way to get things in place is to use the Command Line Interface(CLI) to install ColdFusion, and then use the new Package Manager Command Line Interface (PMCLI) to install the packages you need, scan your code to see what packages you need, download packages locally, and much more!

Of course, that’s not the only advantage. You also will see a lower memory usage when installing the “lite” version. Let’s install the CLI version and check it out.

So to start, head over to the main CF page & click “free trial”. Enter info here into all of the “required” fields. But before you click “DOWNLOAD”, click the very last select box on the page, which by default says “Download Adobe ColdFusion (2021 release) and scroll the select options up by one. It should now say “Windows | English | 147.24MB”. (Alternately, if you’re installing on Linux, scroll the options DOWN one position).

Cool! You got the zip, now unzip it. There will be a folder called “ColdFusion2021” and in there there’s another folder called “ColdFusion”. Copy that over to someplace easy to remember (I just went to C:\ColdFusion) and open up Powershell in administrator mode. Change directories to the (in this case) C:\ColdFusion\cfusion\bin directory and run cfinstall.bat. (in case you’re not a powershell user, you would run the bat by typing .\cfinstall).

Powershell
You’ll be asked to accept the license terms.

Then choose the type of install. I would suggest “Developer Edition” since we’re just playing here. The other options are 30-day trial and a full edition w/ serial number.

Then you’ll be asked about a profile type. Again, we’re playing so choose 3. The other options are production + secure and Production.

Choose an administrator password. It will need to conform to the password rules. Enter it again when prompted. If the two passwords do not match, remove your cat from the keyboard and try again.

Choose a port to run this copy of ColdFusion on. If you’re already running CF locally, it is likely that the default of 8500 is not available.

Choose a service name for ColdFusion.

Then, select a type of deployment. As before, we’ll be choosing Development.

If you’re ready to install, hit Y to proceed.

At this point you’ll see (hopefully) a success message telling you that the service has been successfully installed and that the CF administrator is running at a particular IP/Port and location.

You can test it out by going to that URL in your browser. You’ll be asked for your PW if the server is running correctly. Hopefully it is running. If so, nice!

Now that you have the administrator running, head over to the “Package Manager”. Under “installed packages” you’ll see 2 packages there:
1) adminapi
2) administrator

These are the minimum installed packages required to run Adobe ColdFusion. Under “available packages” you will see all of the optional packages you can install to get your application running. How do you know which packages you’ll need? Well, you can spin up the PMCLI and scan your code, as I describe here. Or you can just hit your site and CF will error with which package is needed to run your code.

For example, I created a page that uses cfimage to make a CAPTCHA, but did not include the “image package”. ColdFusion errors with the following error:

Error

The solution of course is to go to the package manager & install the “Image” package. You can also use the Package Manager CLI to do so as well.

One note, when first installing CF, there’s a LOT of garbage collection that needs doing, and your memory footprint might seem a touch out of whack. A quick restart of the server should clear things up.

1 Comment
2022-06-03 22:26:49
2022-06-03 22:26:49

Good stuff, Mark, and a useful update over the original Adobe blog post here  about the topic when cf2021 first came out. Thanks.

That said, I don’t quite understand the last paragraph here. You’re proposing restarting the server on which cf was installed? I’ve never had to do that nor seen a reason to, after any cf install. Can you elaborate, perhaps? Is this something you’ve seen? or support folks, perhaps?

It’s just that I’ve not, in helping people install it a few hundred times per year. Maybe there’s some scenario I’ve just not encountered, but if so I’d like to leave people with the good news that it may indeed be some rather unique scenario that calls for it. 🙂

Like
(1)
Add Comment