Running the docker image

May 22, 2024
The Jahia Docker images are targeted at developers. If you are a business user and want to evaluate Jahia, we recommend you request a demo.

The Docker images provide a 30-day trial version. After the 30-day trial ends, you can contact us for any license requests.

Installing Docker and running a Jahia Docker image

As Docker is a prerequisite for this tutorial, If you don’t have it installed on your system, you can get it here: https://www.docker.com/get-started

Note: Please ensure that your Docker installation allows allocating up to 4GB of memory to a container. In Docker go to Preferences>Advanced and set the memory limit to 4GB or more instead of the default 2GB.

Assumptions

We will assume the following in the tutorials:

  • $MODULES_DIR points to the parent directory of all the modules developed in these tutorials. It can be anything, but ensure it exists before launching tutorial commands.
  • $MODULE_NAME is the name of a current module's directory, so the full path to a module should always be : $MODULES_DIR/$MODULE_NAME

Here are some examples on Linux/macOS:

export MODULES_DIR=/home/johndoe/java/jahia/modules
export MODULE_NAME=myFirstModule

or on Windows:

set MODULES_DIR=C:/Users/johndoe/java/jahia/modules
set MODULE_NAME=myFirstModule

Starting a Jahia Docker image

After installing Docker, open a Terminal on Linux or Mac, or a Command Prompt on Windows (cmd.exe), and type the following commands, but make sure you replace the $MODULES_DIR placeholder with the proper value (if you didn't set it as an environment variable as in the above examples):

docker run -p 8080:8080 -p 8000:8000 -p 8101:8101 --name jahia-dev -v $MODULES_DIR:/var/jahia/sources  -e JPDA=true jahia/jahia-discovery:latest

This will start up a Jahia Docker instance using exposing the following ports:

  • 8080 for HTTP requests
  • 8000 for remote Java debugging
  • 8101 for SSH access to the built-in Karaf SSH Shell console

The --name jahia-dev parameter allows to give a name to the instance that will be easy to re-use, the -v $MODULES_DIR:/var/jahia/sources  parameter allows to mount a local directory to a remote directory in the container, the -e JPDA=true sets an environment variable in the container that is used by the startup scripts to activate debugging in the embedded Apache Tomcat server and finally the jahia/jahia-discovery:latest is the Jahia Docker image (in this case the discovery image that already contains demo content) that we want to use with the latest version tag

The initial startup of Jahia takes a few minutes. When Jahia finishes starting, you should see a message that looks like this:

--------------------------------------------------------------------------------------------------
 D E V E L O P M E N T   M O D E A C T I V E

 In development mode, Jahia will allow JSPs to be modified, modules to be
 re-deployed and other modifications to happen immediately, but these DO have a performance impact.
 It is strongly recommended to switch to production mode when running performance tests or going live.
 The setting to change modes is called operatingMode in the jahia.properties configuration file.
--------------------------------------------------------------------------------------------------
 Modules:
     Started: 75
--------------------------------------------------------------------------------------------------
 Jahia 8.x.x.x - Enterprise Distribution - Initialization completed in 268 seconds
--------------------------------------------------------------------------------------------------

Logging into Jahia

You are now ready to connect to the Jahia server. Simply open a supported browser and enter the following URL:
http://localhost:8080, you will be redirected to Digitall, our pre-imported demo site.

You can log in by clicking on the "Login" link at the top right of the screen in the top black bar using the following default credentials:

Username: root
Password: root1234

Next steps

You can now either test the system or continue with tutorials by creating your first module.