OpenCms Documentation

The setup script

 Show GitHub edit links  Hide GitHub edit links
In OpenCms since: 9.0 Documented since: 9.5 Latest revision for: 9.5 Valid for OpenCms: 12.0

OpenCms can be installed automatically. Parameters used in the installation are provided via a config file and then an Java program shipped with OpenCms sets up OpenCms. Here you'll learn how to set up OpenCms using the auto-setup.

Why using the auto-setup?

You always have the choice between using the setup wizard or the auto-setup. While the wizard provides a convenient way to setup OpenCms using a graphical interface, the auto-setup allows automating the setup.

Here are some situations when the auto-setup is preferable:

  • OpenCms should be installed on a server where you cannot access the setup wizard via a browser.
  • You want to use the same configuration more than once.
  • The configuration is provided by a person other than the one installing OpenCms.
  • You want to automate the complete server setup, integrating OpenCms installation in a larger script.

Starting the auto-setup

To start the auto-setup, you must have installed Tomcat and deployed OpenCms on it. If so, just run:

java -classpath "$OPENCMS/WEB-INF/lib/*:$OPENCMS/WEB-INF/classes:/usr/share/tomcat7/lib/*"\

In the command we use the variables

  • $OPENCMS for the path to OpenCms' web-app root folder. For example, on an Ubuntu Server (14.04) where Tomcat is installed via the repository and OpenCms is deployed as the ROOT app, the path would be /var/libs/tomcat7/webapps/ROOT/.
  • $CONFIG_FILE for the path to the configuration file used by the auto-setup.
Executing the auto-setup may take some time. At least when it comes to the modules import it will take some time until you get a status update from the setup program. Just wait.

The configuration file

In the configuration file, you provide parameters for all the settings otherwise entered when running the setup wizard. In particular, you specify which components of OpenCms should be installed, how OpenCms connects to a database and how the installation is reached on your server.

The configuration file is a simple text file with key-value pairs, each on a separate line and written as


The keys that should be set are handled by the class org.opencms.setup.CmsAutoSetupProperties and are all explained in the class' JavaDoc.

Here, we only provide an example configuration file.



Note that all configurations can be overwritten by Java system properties. The setting for setup.install.components can also be overritten by an environment variable.

You can improve this page

Please contribute your suggestions or comments regarding this topic on our wiki. For support questions, please use the OpenCms mailing list or go for professional support.