Create Project and Access Hub Central

Before you begin

You need:


  1. Create a directory for your Data Hub project. This directory will be referred to as "your project root" or simply "root".
  2. Open a command-line window, and go to your project root directory.
  3. In your project root directory, create a build.gradle file with the Grade Properties plugin setting and the Data Hub plugin setting.

    Copy the following to your build.gradle file and replace the version number with the Data Hub version that you are using.

       plugins {
          // Gradle Properties plugin
          id '' version '1.4.6'
          // Data Hub plugin
          id '' version 'VERSION_NUMBER'
      } Gradle Properties plugin Allows you to create different environments for your Gradle deployment and set up a file, where env is the environment name. When running a Gradle task, you can specify the target environment with the environmentName option. For more information, see Data Hub plugin Extends the ml-gradle plugin with Data Hub-specific commands.
  4. Initialize your Data Hub project.
    gradle hubInit -i
  5. Create a JSON file to store a Hub Central user in the your-project-root/src/main/ml-config/security/users directory.

    Example JSON file contents for the hub-central-developer role:

      "user-name": "user-name",
      "description": "description",
      "password": "password",
      "role": [
    Important: MarkLogic recommends using a JSON file to store new users, not existing users. If you supply the name of an existing user, such as the MarkLogic Server admin, be aware that roles specified in the JSON file will replace the roles already assigned to that existing user.
    Note: For additional details about Hub Central roles, see Default Hub Central Roles.
  6. Specify the username and password for the Data Hub plugin to use when communicating with MarkLogic Server. See Set the Security Credentials Using Gradle.
  7. Deploy your Data Hub project to a Data Hub instance.
    gradle mlDeploy -i
  8. Download the marklogic-data-hub-central-VERSION_NUMBER.war file.
  9. Run the Hub Central .war.
    • To use the default port number for the internal web server (port 8080):
      java -jar marklogic-data-hub-central-VERSION_NUMBER.war
    • To use a few configured properties set using the command line; e.g., port 8020 used by the STAGING app server:
      java -jar marklogic-data-hub-central-VERSION_NUMBER.war --mlStagingPort=8020
    • To use many configured properties placed in a single external configuration file; e.g., file (single-environment gradle properties):
      java -jar marklogic-data-hub-central-VERSION_NUMBER.war --spring.config.additional-location=file:/path/to/project/
    • To use many configured properties placed in multiple external configuration files; e.g., and files (multiple-environment gradle properties):
      java -jar marklogic-data-hub-central-VERSION_NUMBER.war --spring.config.additional-location=file:/path/to/project/,file:/path/to/project/
      Important: The file should be set before the file. This ensures that environment-specific properties have priority over the other properties.

    For the full list of configurable properties, see Data Hub Properties.

    Note: If you are using Windows and a firewall alert appears, click Allow access.
    Note: If you are using both QuickStart and Hub Central, there will be a port conflict on port 8080.

What to do next

  • After the project is initialized, all project team members must use the Gradle wrapper in the initialized project to run Gradle tasks. This ensures that everyone uses the same version of Gradle.