Deploy Neo4j using the Neo4j RPM package

This section describes how to deploy Neo4j using the Neo4j RPM package on Red Hat, CentOS, Fedora, or Amazon Linux distributions.

1. Install on Red Hat, CentOS, Fedora or Amazon Linux

1.1. Standard installation

  1. Add the repository.

    Use the following as root to add the repository:

    rpm --import https://debian.neo4j.com/neotechnology.gpg.key
    cat <<EOF >  /etc/yum.repos.d/neo4j.repo
    [neo4j]
    name=Neo4j RPM Repository
    baseurl=https://yum.neo4j.com/stable
    enabled=1
    gpgcheck=1
    EOF
  2. Ensure the correct Java version.

    Neo4j 4.3 requires the Java 11 runtime. Most of our supported RPM Linux distributions have Java 11 available by default. There is some minor setup required for Amazon Linux, and for compatibility with Oracle Java 11:

    • Java 11 on Amazon Linux:

      To enable OpenJDK 11 on Amazon Linux run the shell command:

      amazon-linux-extras enable java-openjdk11

      You are now ready to install Neo4j 4.3.2, which will install Java 11 automatically if it is not already installed.

    • Oracle Java 11:

      Oracle and OpenJDK provide incompatible RPM packages for Java 11. We provide an adapter for Oracle Java 11 which must be installed before Neo4j. The adapter contains no code, but will stop the package manger from installing OpenJDK 11 as a dependency despite an existing Java 11 installation.

      This step assumes that you have performed the previous step to set up the yum repository.

      1. Download and install the Oracle Java 11 JDK from the Oracle website.

      2. Install the adapter:

        sudo yum install https://dist.neo4j.org/neo4j-java11-adapter.noarch.rpm

        The SHA-256 of the adapter package can be verified against https://dist.neo4j.org/neo4j-java11-adapter.noarch.rpm.sha256.

    You are now ready to install Neo4j 4.3.2.

  3. Install Neo4j.

    • To install Neo4j Community Edition as root:

      yum install neo4j-4.3.2
    • To install Neo4j Enterprise Edition as root:

      yum install neo4j-enterprise-4.3.2
  4. Run the following to return the version and edition of Neo4j that has been installed:

    rpm -qa | grep neo

Neo4j supports Security-Enhanced Linux (SELinux), by default.

1.2. Non-interactive installation of Neo4j Enterprise Edition

When installing Neo4j Enterprise Edition, you will be required to accept the license agreement before installation is allowed to complete. This is an interactive prompt. If you require non-interactive installation of Neo4j Enterprise Edition, you can indicate that you have read and accepted the license agreement by setting the environment variable NEO4J_ACCEPT_LICENSE_AGREEMENT to yes:

NEO4J_ACCEPT_LICENSE_AGREEMENT=yes yum install neo4j-enterprise-4.3.2

2. Install on SUSE

For SUSE-based distributions the steps are as follows:

  1. Use the following as root to add the repository:

    zypper addrepo --refresh https://yum.neo4j.com/stable neo4j-repository
  2. Install Neo4j.

    • To install Neo4j Community Edition as root:

      zypper install neo4j-4.3.2
    • To install Neo4j Enterprise Edition as root:

      zypper install neo4j-enterprise-4.3.2

3. Offline installation

If you cannot reach https://yum.neo4j.com/stable to install Neo4j using RPM, perhaps due to a firewall, you will need to obtain Neo4j via an alternative machine which has the relevant access, and then move the RPM package manually.

It is important to note that using this method will mean that the offline machine will not receive the dependencies that are normally downloaded and installed automatically when using yum for installing Neo4j; Neo4j Cypher Shell and Java.

For information on supported versions of Java, see System requirements.

3.1. Downloading the RPM installers

The Cypher Shell RPM package can be downloaded from Neo4j Download Center.

  1. Run the following to obtain the required Neo4j RPM package:

    • Neo4j Enterprise Edition:

      curl -O https://dist.neo4j.org/rpm/neo4j-enterprise-4.3.2-1.noarch.rpm
    • Neo4j Community Edition:

      curl -O https://dist.neo4j.org/rpm/neo4j-4.3.2-1.noarch.rpm
  2. Manually move the downloaded RPM packages to the offline machine.

If using Oracle Java 11, the same dependency issues apply as with the standard installation. You will need to additionally download and install the Java adaptor described in that section:

  • To install Neo4j Enterprise Edition as root:

    curl -O https://dist.neo4j.org/neo4j-java11-adapter.noarch.rpm

3.2. Performing an offline installation

3.2.1. Offline upgrade from 4.0.0 or later

  • Neo4j 4.0.0 and onwards already require Java 11, so there should be no additional Java setup required.

  • Neo4j Cypher Shell must be installed before Neo4j, because it is a dependency.

  • Run the following on the offline machine to install Neo4j Cypher Shell and Neo4j simultaneously:

    rpm -U <Cypher Shell RPM file name> <Neo4j RPM file name>

    This must be one single command, and Neo4j Cypher Shell must be the first package in the command.

3.2.2. Offline upgrade from 3.5 or earlier

  • Due to dependency conflicts with older versions, for offline upgrades from 3.5 or earlier, Neo4j Cypher Shell and Neo4j must be upgraded simultaneously.

  • Before you begin, you will need to have Java 11 pre-installed. For Oracle Java 11 only, you must install the Oracle Java adapter before trying to install Neo4j.

  • Run the following on the offline machine to install Neo4j Cypher Shell and Neo4j simultaneously:

    rpm -U <Cypher Shell RPM file name> <Neo4j RPM file name>

    This must be one single command, and Neo4j Cypher Shell must be the first package in the command.