Magnolia 5.7 reached extended end of life on May 31, 2022. Support for this branch is limited, see End-of-life policy. Please note that to cover the extra maintenance effort, this EEoL period is a paid extension in the life of the branch. Customers who opt for the extended maintenance will need a new license key to run future versions of Magnolia 5.7. If you have any questions or to subscribe to the extended maintenance, please get in touch with your local contact at Magnolia.
This page provides instructions on how to do a basic installation of Magnolia using the Magnolia CLI. You should do this before starting the Hello Magnolia for front-end developers tutorial.
java -versionin a terminal or command prompt. If the system reports a version number, Java is installed on your computer.
$ java -version java version "10.0.1" 2018-04-17 Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
If you don't have Java, install it:
Java is not pre-installed on Mac OS X 10.7 and later. Download the latest Java from Oracle.
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.
What is the difference?
- JRE is for users who run Java programs on their computer.
- JDK is for developers who write Java-based applications.
Download and install JDK. By default JDK is installed in
C:\Program Files\Java\jdk-10.0.xx\. You can choose another location.
Check JAVA_HOME environment variable
- Open the command prompt.
setand press ENTER.
JAVA_HOMEin the command output and verify that the path points to your JDK installation directory, for example
JAVA_HOMEis missing or it points to the wrong directory, see Set JAVA_HOME environment variable below.
Set JAVA_HOME environment variable
- Right-click My Computer and select Properties.
- Go to the Advanced tab.
(In Windows 7+, right-click Computer and select Advanced System Settings, then Environment variables.)
- If the
JAVA_HOMEenvironment variable does not exist in User variables or System variables, create it:
- User variables apply to the currently signed-in user only. Create
JAVA_HOMEhere if you want it to apply only to the currently logged in user. These variables take precedence over system variables.
- System variables apply to all users. Create
JAVA_HOMEhere if you want it to apply to all users. You must be an administrator to modify a system environment variable.
- User variables apply to the currently signed-in user only. Create
- Set the value of
JAVA_HOMEto the path of your JDK installation directory, for example
- Optional step: Add the Magnolia
bindirectory to the
PATHvariable, for example
C:\Program Files\magnolia\apache-tomcat-x.y\bin. Setting the
PATHallows you to issue the Magnolia
stopcommands from anywhere without navigating to the installation directory first. Separate the path from existing paths with a semicolon ( ; ). If you do this, you also need to add
CATALINA_HOMEto environment variables. Set the value of
CATALINA_HOMEto the Tomcat installation directory, for example
- Click OK.
- Go back to Check JAVA_HOME environment variable above and test that the variable is found and has the correct value. You need to open a new command prompt since environment variables are session specific.
Alternatively you can set JAVA_HOME with a batch file. Add this line to
set JAVA_HOME=C:\Program Files\Java\jdk-10.0.xx
set command creates the
JAVA_HOME environment variable and sets its value to the JDK directory. The command is executed when Magnolia starts.
Download the latest Java from Oracle. The installation directory varies from one Linux system to another. For example, on Ubuntu Linux 10 the OpenJDK Runtime Environment is installed in
/usr/lib/jvm/java-10-openjdk/jre by default.
Download the latest Java from Oracle. You can install it in any directory such as
To check the version of your node installation run the following command in a shell:
Install Magnolia CLI
npm install @magnolia/cli -g
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.
On Linux or Mac OS X to run this command as root use:
sudo npm install @magnolia/cli -g
If the installation is successful, you see the following or a similar output in the shell:
/usr/bin/mgnl -> /usr/lib/node_modules/@magnolia/cli/bin/mgnl.js > firstname.lastname@example.org postinstall /usr/lib/node_modules/@magnolia/cli/node_modules/spawn-sync > node postinstall + @email@example.com added 209 packages in 11.40
If you already installed Magnolia CLI, update to the latest version:
npm update @magnolia/cli -g
Once you have installed Magnolia CLI, test the installation by running the following command in the shell:
Usage: mgnl <command> [options] A tool to setup and facilitate light development with Magnolia CMS Options: -V, --version output the version number -h, --help output usage information Commands: jumpstart download and setup a Magnolia CMS instance for development. start start up a Magnolia CMS instance. To stop it, enter CTRL+C add-availability add component availability. build scan a node_modules folder for npm packages with the keyword "magnolia-light-module" (in package.json) and extract them to a directory of choice. create-component create a component and optionally add availability for it. create-light-module create a light module. create-page create a page template. customize-local-config extract "mgnl-cli-prototypes" folder and "mgnl-cli.json" file to customize CLI configuration. install install a light module from npm to the local Magnolia instance. search search for a light module on npm. tab-completion install tab autocomplete feature for Bash, zsh or PowerShell help [cmd] display help for [cmd] mgnl: 2.2.0 node: v6.11.0 os: darwin
jumpstartcommand to install Magnolia. This command downloads, unpacks and pre-configures a Magnolia bundle of your choice.
jumpstart command automatically creates a light modules directory for you in the current folder. If you already have a different directory that you want to use for light modules, use the
-p option with the jumpstart command to specify the path to your existing light modules folder. For example:
mgnl jumpstart -p /Users/<username>/<shared-projects>/light-modules/
To install Magnolia:
Change to the directory to where you want to install the Magnolia bundle. For example:
Execute the Magnolia CLI
magnolia-community-demo-webappcontaining 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 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 superuser
The following files and folders are created:
dev/ ├── apache-tomcat/ │ ├── bin/ │ ├── conf/ll │ ├── lib/ │ ├── logs/ │ ├── temp/ │ └── webapps/ ├── light-modules/ └── downloads
apache-tomcatdirectory and execute the Magnolia CLI
When starting for the first time, Magnolia runs a web update and automatically installs all its modules.
http://localhost:8080/magnoliaAuthorand sign in as:
The app launcher is displayed and Magnolia is ready to use.
superuser is a system administrator account that has permissions to do everything. It is useful for testing.