Install script for Linux and Mac
An automatic installation script is available for Linux and Mac. This script is interactive and will:
Create a user for Mango to run under (Linux only)
Create a H2 or MySQL database
Download and extract the Mango zip file to your chosen installation directory
Create a pre-configured env.properties file in overrides
Create a self-signed SSL/TLS certificate
Register a systemd service so Mango starts at boot (Linux only)
Requirements
Your operating system is Linux or Mac OS
Java JDK is installed and either
JAVA_HOME environment variable points to the JDK installation directory
The JDK bin directory is available on your path (specifically the java, keytool, and jar commands are available)
(MySQL only) The mysql command is available on the path and the root user can run SQL without a password
Instructions
You must run the script as root. If you have any reservations about doing so, please see our manual installation instructions for your operating system.
Download the script
curl -o install-mango.sh https://raw.githubusercontent.com/infiniteautomation/ma-core-public/main/Core/bin/install-mango.sh
Run the script
If logged in as root:
sh install-mango.sh
Using sudo to run the script as root:
sudo sh install-mango.sh
Answer the prompts
The script will prompt you to enter details about where to install Mango, which version of Mango to install etc. Hit enter and accept the default option shown inside the square brackets [default]. Yes/no answers must be written as ‘yes’ or ‘no’, ‘y’ or ‘n’ are not sufficient.
Advanced options
You can automate the script by providing answers to the prompts using environment variables. e.g.
MA_HOME=/opt/mango MA_USER=mango MA_DB_TYPE=h2 MA_VERSION=3.6.5 sh install-mango.sh
Environment variables
MA_HOME — The directory in which to install Mango
MA_USER — The OS username under which Mango will run (will be created if user doesn’t exist)
MA_SERVICE_NAME — The systemd service name which will be installed
MA_DB_TYPE — The SQL database type for the installation [h2/mysql]
MA_DB_NAME — The SQL database name which will be created
MA_DB_USER — The SQL database user (will be created if user doesn’t exist)
MA_DB_PASSWORD — The SQL database user’s password
MA_CONFIRM_DROP — Confirms that the SQL DB should be dropped (MySQL only) [yes/no]
MA_CONFIRM_DELETE — Confirms that the contents of the installation directory can be deleted [yes/no]
MA_CORE_ZIP — Path to a installation zip file to use instead of downloading one
MA_VERSION — The version of Mango to install e.g. latest or 3.6.5