Creating a Blog site with ContentBox on Ubuntu

[ This post is part of my ongoing instructional series on setting up some baseline IT infrastructure for the fictional startup Shoestring Lab. Shoestring has committed to using Open Source wherever possible. Shoestring Lab has standardized on Ubuntu for its server and desktop/laptop computer systems.

Today's lesson

Shoestring Lab has decided to set up several website for its operations, and you have been tasked with using ContentBox to build the first site, an internal content and blog site.]


Installing ContentBox

You can install the latest installer version of ContentBox from the CommandBox CLI.

Open a command prompt and make a directory for your soon-to-be site, then open CommandBox:

cd /storage/git
mkdir shoestring
cd shoestring

Use the command install contentbox-installer to download and install ContentBox:

If you look in the ./shoestring folder, you should now have something like this set of files and folders there:

Before you start the server and configure ContentBox, you will need to add some information to the server.json config file in ./shoestring. Go to /home/<username>/.CommandBox/server. Inside that folder should be a folder for your new server. It should look something like this:


Copy that folder name. Now open ./shoestring/server.json in a text editor. You should see a JVM entry that looks like this:


You need to add some arguments for the JVM:

        "args":"-Djava.awt.headless=true -javaagent:/home/<username>/.CommandBox/server/4C00C7BF5FD5144542BCDF9C552D6902-shoestring/lucee-"

Verify that the Lucee folder inside the server entry is the same as this example. If you version of Lucee is different, the folder will have a different name. Rename it appropriately. Make sure to replace <username> with the user account where the .CommandBox folder exists.

Next, back at the CommandBox prompt, start your new server by typing:

server start

In a few seconds, a browser window should open to the ContentBox installation page:


Before you proceed, open another browser tab and set admin passwords for Lucee. Don't update the server version just yet, as that will restart the service and may give the installer a bit of trouble.

Once you have the admin password set, go back to the installer tab.

Select "No" as the answer to the question of whether you have a datasource created already. You should then be able to scroll down to see the new datasource form.

You need an empty database that is accessible to your Lucee instance. Shoestring uses MariaDB as the standard RDBMS, and you already have a new db in your local MariaDB instance called "shoestring". Fill out the form like so:

Click Verify Data to submit the form and get started with ContentBox. The Install Wizard will run next. Fill out the Administrator information with your personal information:

Click Next Step. Fill out this form with site information. If you are unfamiliar with content management applications, leave the "Populate Site with Sample Docs" checked and the system will generate some sample content for you.

Click Next Step to move on. The next screen will show you information about URL Rewrites. Leave on URL Rewrites and select CommandBox URL re-writes:

Click Start Installation! 

Congratulations, ContentBox has been installed! Click Visit Site to go to the homepage of your new site. Click Visit Administrator to go to the admin homepage for the ContentBox site.

For reference, the ContentBox admin is at: <host>/cbadmin/. You will be asked to login with the ContentBox Administrator information you entered during the installation.