Install Magnolia
This page provides instructions on how to do a basic installation of Magnolia using the Magnolia CLI v4. You should do this before starting the Hello Magnolia for front-end developers tutorial.
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.
See Certified stack to confirm that the version installed is supported. For local development, use
|
On Windows, you need a Java SE Development Kit (JDK). The Java Runtime Environment (JRE) is not enough because the Tomcat application server does not recognize it.
-
JRE is for users who run Java programs on their computers.
-
JDK is for developers who write Java-based applications.
Download and install JDK.
By default, JDK is installed at C:\Program Files\Java\jdk-<version>\
.
Instructions | |||
---|---|---|---|
Check for |
|
||
Set |
The |
For Mac, you need to download or update to Java 17
or higher.
After reviewing and agreeing to the terms of the license agreement, download the file, then double-click it to launch the installation wizard and follow the installation instructions.
The installation directory varies from one Linux system to another.
On Debian-based distributions, JREs or JDKs are usually installed in /usr/lib/jvm/
.
Get node.js
Magnolia CLI is an npm package providing a command line interface (CLI) tool to set up and facilitate light development with Magnolia. The Magnolia CLI tool runs on Node.js. If you do not have Node.js installed, go to Node.js and download and install the latest LTS version.
To check the version of your node installation, run the following command in a shell:
node -v
Get Magnolia CLI
Run the following command in a shell to install Magnolia CLI:
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 help
The command should display the following:
[mgnl 5]
Usage: [options] [command]
CLI for light development of Magnolia projects
Options:
-V, --Version output the version number
-h, --help display help for command
Commands:
generate-plugin [options] generate a basic structure for a new CLI plugin
jumpstart [options] download and set up a new headless or freemarker-based project with
Magnolia webapp
help [command] display help for command
Installing Magnolia with CLI only
Use the jumpstart
command to install Magnolia.
This command downloads, unpacks and pre-configures a Magnolia bundle of your choice.
To install a specific Magnolia version, use the
To see a list of options available for any Magnolia CLI command, use the command together with the
|
To install Magnolia:
-
Change to the directory to where you want to install the Magnolia bundle. For example:
cd /Users/<username>/dev/
-
Execute the Magnolia CLI
jumpstart
plugin command:mgnl jumpstart
-
Choose the
demo-webapps
template, followed by themagnolia-community-demo-webapp
template containing Magnolia Community Edition bundled with the Travel Demo and a Tomcat server. It creates folders for the Tomcat server and for the light modules according to the CLI configuration.Once the setup operation is complete, you should see a message similar to this one:
info: Project successfully downloaded info: Run "npm run mgnl" to see the list of registered commands info: Start the project using: "npm run mgnl -- start" info: If the "StartPlugin" is not available, install it using: "npm run mgnl -- add-plugin @magnolia/cli-start-plugin" info: For additional plugins and features, refer to the Magnolia CLI documentation: https://docs.magnolia-cms.com/magnolia-cli
Start Magnolia with CLI
Go to the parent directory of the apache-tomcat
directory and execute
the Magnolia CLI start
command:
mgnl start
When starting for the first time, Magnolia runs a web update and automatically installs all its modules.
Login
Go to http://localhost:8080/magnoliaAuthor
and sign in as a superuser
:
-
Username:
superuser
-
Password:
superuser
Magnolia is ready to use and gives you a list of suggestions to get started.
superuser is a system administrator account that
has permissions to do everything. It is useful for testing.
|