There are three ways to configure ModeShape, and it depends on how you're deploying your application.
Embedded ModeShape - In all other cases, ModeShape runs within your application, whether your application is a regular Java SE application or a web application deployed to a web container. This means that your application needs to create a single ModeShape engine, deploy a JSON configuration file for each of the repositories needed by your application, and shut down the engine when your application is shut down. See ModeShape in Java applications for more details.
ModeShape and JBoss Wildfly - When ModeShape is installed into JBoss Wildfly, it is configured using the Wildfly configuration and tools (e.g., the command line interface, or CLI). For more details, see Configuring ModeShape in Wildfly.
ModeShape via JCA - When your application is to be deployed to an environment that supports the Java Connector Architecture (JCA), then you can deploy ModeShape repositories via ModeShape's JCA adapter (available in ModeShape 3.1 or later). See ModeShape's JCA Adapter for more details.
You have to decide how you want to persist your repository data and binary data.
Optionally add one or more index providers to your configuration.
Optionally add one or more sequencers to your configuration
Optionally add one or more external sources to your configuration
See how to cluster an embedded repository or how to cluster a repository in Wildfly