Skip to main content
Version: 5.4

Installing Hazelcast Community Edition

You can install the Community Edition of Hazelcast, using the command line interface (CLI), Docker, the binary, or Java.

note

These instructions apply only to the Community Edition. If you have a license, which allows you to take advantage of the additional features offered by Enterprise Edition, follow the instructions in the Installing Hazelcast Enterprise Edition topic.

Both slim and full distributions are available. For further information on the available editions and distributions, see the Hazelcast Editions and Distributions topic.

You must use one of the following installation methods if you want to install the slim distribution:

To install a slim distribution, append -slim to the version number in the commands shown in the following sections; for example, to install the slim distribution of 5.4.5, use 5.4.5-slim.

Using a Package Manager​

Hazelcast offers package managers for Linux and Mac operating systems.

Package managers are the fastest way of installing 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 one of the following methods, depending on your operating system:

    To install on macOS, use the Homebrew package manager.

    bash
    brew tap hazelcast/hz
    brew install hazelcast@5.4.5
  2. Check that Hazelcast is installed.

    shell
    hz -V

    You should see the version of both Hazelcast and the command-line client (CLI).

  3. Start the cluster.

For more information about the package manager, see the GitHub repository.

Using Docker​

  1. Install Docker.

  2. Check that Docker is correctly installed.

    bash
    docker version
  3. If you do not see a version number, see the Docker docs for troubleshooting information.

  4. Start the cluster.

Using the Binary​

Download the latest snapshot archive and extract the binaries.

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

To start the cluster, see Start a Local Cluster from Binary.

Using Java​

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

  • Maven
  • JAR file
  • Modular Java

Using 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>
    <version>5.4.5</version>
    </dependency>
    </dependencies>
  3. Start the cluster.

Using the JAR​

If you aren't using a build tool:

Using 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 modulepath, use the com.hazelcast.core for hazelcast-5.4.5.jar module name.

The JPMS comes with stricter visibility rules. It affects Hazelcast which 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 --add-exports and --add-opens (for reflective access) Java arguments.

Running 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-5.4.5.jar
Running a Member on the Modulepath
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 expects the hazelcast-5.4.5.jar file in the lib directory.

Next Steps​

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