Skip to main content
Version: 6.0-SNAPSHOT

Install Hazelcast Community Edition

You can install the Community Edition of Hazelcast using a package manager, Docker, or the binary. Alternatively, you can add Hazelcast as a dependency in your Java project.

note

These instructions apply only to the Community Edition. If you have an Enterprise Edition license, follow the instructions in Install Hazelcast Enterprise Edition.

We recommend that you learn more about the benefits of an Enterprise Edition license to ensure that you do not require any of the additional functionality or support before you install Community Edition. If you continue with the Community Edition installation, you can move your Community Edition members to Enterprise Edition at any time if you subsequently want to benefit from the Enterprise Edition functionality without downtime.

For further information on Enterprise Edition features, see Hazelcast editions and distributions. To migrate from Community Edition to Enterprise Edition, see Upgrade to Enterprise Edition.

Distributions​

Both slim and full distributions are available. You can access the slim distribution using Docker or by downloading the binary:

See Hazelcast editions and distributions for more information.

Use a package manager​

Hazelcast offers package managers for Linux and macOS operating systems.

Package managers are the fastest way to install Hazelcast. This option is for development purposes and is only available for Hazelcast Community Edition. For production, use the other deployment options explained on this page.

  1. To install Hazelcast, use the appropriate command for your operating system:

    To install on macOS, use the Homebrew package manager.

    bash
    brew tap hazelcast/hz
    brew trust hazelcast/hz
    brew install [email protected]
  2. Check that Hazelcast Platform is correctly installed:

    shell
    hz -V

    You should see the version of both Hazelcast and the command line tool.

For more information about the packages, see the GitHub repository.

Use Docker​

  1. Install Docker.

  2. Check that Docker is correctly installed.

    bash
    docker version

    If you do not see a version number, see the Docker documentation for troubleshooting information.

  3. Pull the Hazelcast Docker image:

    shell
    docker pull hazelcast/hazelcast:6.0.0-SNAPSHOT

Use the binary​

Download the Hazelcast archive and extract the binaries:

  1. Download a package from hazelcast.com.
  2. Extract the downloaded package.

Use Java​

To install Hazelcast with Java, you can use one of the following:

  • Maven
  • JAR file
  • Modular Java

Use Maven​

Hazelcast runs on Java, which means you can add it as a dependency in your Java project.

The Java package includes both a member API and a Java client API. The member API is for embedded topologies where you want to deploy and manage a cluster in the same Java Virtual Machine (JVM) as your applications. The Java client is for connecting to an existing member in a client/server topology, such as Hazelcast Cloud.

  1. Download and install a supported JDK.

  2. Add the following to your pom.xml file.

    xml
    <dependencies>
    <dependency>
    <groupId>com.hazelcast</groupId>
    <artifactId>hazelcast</artifactId> (1)
    <version>6.0.0-SNAPSHOT</version> (2)
    </dependency>
    </dependencies>
    1 Hazelcast Community Edition dependency.
    2 Hazelcast Community Edition version.

Use modular Java​

You can use Hazelcast as a module in the Java Platform Module System (JPMS).

To run your application with Hazelcast libraries on the module path, use com.hazelcast.core for the hazelcast-6.0.0-SNAPSHOT.jar module name.

If you use JPMS, it enforces stricter visibility rules and Hazelcast uses the internal Java API to reach the best performance results.

Hazelcast needs the java.se module and access to the following Java packages:

  • java.base/jdk.internal.ref
  • java.base/java.nio (reflective access)
  • java.base/sun.nio.ch (reflective access)
  • java.base/java.lang (reflective access)
  • jdk.management/com.ibm.lang.management.internal (reflective access)
  • jdk.management/com.sun.management.internal (reflective access)
  • java.management/sun.management (reflective access)

You can provide access to these packages by using simple --add-exports and --add-opens (for reflective access) Java arguments.

Run a member on the classpath
bash
java --add-modules java.se \
--add-exports java.base/jdk.internal.ref=ALL-UNNAMED \
--add-opens java.base/java.lang=ALL-UNNAMED \
--add-opens java.base/java.nio=ALL-UNNAMED \
--add-opens java.base/sun.nio.ch=ALL-UNNAMED \
--add-opens java.management/sun.management=ALL-UNNAMED \
--add-opens jdk.management/com.ibm.lang.management.internal=ALL-UNNAMED \
--add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED \
-jar hazelcast-6.0.0-SNAPSHOT.jar
Run a member on the module path
bash
java --add-modules java.se \
--add-exports java.base/jdk.internal.ref=com.hazelcast.core \
--add-opens java.base/java.lang=com.hazelcast.core \
--add-opens java.base/java.nio=com.hazelcast.core \
--add-opens java.base/sun.nio.ch=com.hazelcast.core \
--add-opens java.management/sun.management=com.hazelcast.core \
--add-opens jdk.management/com.ibm.lang.management.internal=com.hazelcast.core \
--add-opens jdk.management/com.sun.management.internal=com.hazelcast.core \
--module-path lib \ (1)
--module com.hazelcast.core/com.hazelcast.core.server.HazelcastMemberStarter
1 This example requires the hazelcast-6.0.0-SNAPSHOT.jar file in the lib directory.

Next steps​

To continue learning about Hazelcast, start a local cluster using Docker, the binary, or Java.