This tutorial leverages version 4 of Magnolia CLI.
This page explains how you can use npm CLI to install the Community Edition of Magnolia.
Prerequisites
Get Java
Magnolia needs at least a Java Runtime Environment (JRE) to run.
Check if there’s a version of Java already installed on your computer by opening the terminal or command prompt and typing java -version.
If the system reports a version number, Java is installed on your computer.
The steps below leverage version 4 of Magnolia CLI.
Run the following command in a shell to install
Magnolia CLI:
You must use CLI version 4.0.12 or later to install Magnolia 6.3.
Mac or Linux
Windows
sudo npm install @magnolia/cli -gCopy
npm install @magnolia/cli -g (1)Copy
1
Depending on your permissions and the location where you have installed
Node.js, you may have to execute the command above with root
permissions. Without installation permissions you will notice messages
such as npm ERR! in the shell.
Once you have installed Magnolia CLI, test the installation by running
the following command in the shell:
mgnl helpCopy
Downloading Magnolia
Let’s assume that the directory where you intend to download and install
Magnolia is called magnolia.
Change to this directory and open a shell.
Enter the following command, where with <version> you may specify
the Magnolia release you wish to download.
(If you don’t specify the version and run the command without the -m
switch, CLI will download the latest release of the most recent Magnolia branch.
mgnl jumpstart -m <version>Copy
When prompted to choose a Magnolia bundle, enter 3 for the
magnolia-community-demo-webapp.
The jumpstart command:
Downloads the Magnolia bundle specified into the magnolia directory.
Creates a light-modules folder in the directory.
Changes the default value of the magnolia.resources.dir
configuration property from ${magnolia.home}/modules to
/magnolia/light-modules for both the Author and the Public instances
of Magnolia.
Once the setup operation is complete, you should see a message similar
to this one:
info Magnolia has been successfully setup for light development!
info You can now open a new terminal tab or window and start it up with the CLI command'mgnl start'
info Magnolia will be ready after a few seconds at localhost:8080/magnoliaAuthor. Username and password is superuserCopy
Starting Magnolia
In the parent directory of light-modules, enter:
mgnl startCopy
The command installs and starts Magnolia. This is complete when you see
a message like Server startup in 112737 ms. You can then access the UI
of the Author instance.
If you set a new superuser password in a properties file before starting up a fresh installation, you must delete the password from the properties file.
This is necessary to avoid a security vulnerability.
Ensure any bootstrapped password is removed after logging in the first time.