Red Hat, CentOS, Fedora, and Amazon Linux (.rpm)

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

If you follow guidelines such as STIG RHEL 8 must mount /tmp with the noexec option, you may have /tmp mounted with the noexec option. This could cause a conflict, as the Neo4j Admin tool uses zstd to compress files. However, Java supports pointing to an alternative temp directory by either setting dbms.jvm.additional=-Djava.io.tmpdir=/path/that/has/exec/permissions in the neo4j.config file, or in the JAVA_OPTS environment variable.

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 <  /etc/yum.repos.d/neo4j.repo
    [neo4j]
    name=Neo4j RPM Repository
    baseurl=https://yum.neo4j.com/stable/4.4
    enabled=1
    gpgcheck=1
    EOF

    If you are upgrading from an older version of Neo4j, you may need to clear the package manager cache before Neo4j packages become available: yum clean dbcache

  2. Ensure the correct Java version.

    Neo4j 4.4 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.4.34, 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.4.34.

  3. Install Neo4j.

    • To install Neo4j Community Edition as root:

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

      yum install neo4j-enterprise-4.4.34

      When installing Neo4j Enterprise Edition, you will be required to accept the license agreement before the interactive installation is allowed to complete.

  4. Run the following to return the version and edition of Neo4j that has been installed:

    rpm -qa | grep neo

Non-interactive installation of Neo4j Enterprise Edition

For a non-interactive installation, you can set the environment variable NEO4J_ACCEPT_LICENSE_AGREEMENT to yes to indicate that you have read and accepted the license agreement. This should be done in the same line as the package is installed, to ensure bash correctly passes the environment variable to the installer process. As in the following example:

Non-interactive installation of Enterprise Edition under the commercial license
NEO4J_ACCEPT_LICENSE_AGREEMENT=yes yum install neo4j-enterprise-4.4.34

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.4.34
    • To install Neo4j Enterprise Edition as root:

      zypper install neo4j-enterprise-4.4.34

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 that 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.

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.4.34-1.noarch.rpm
    • Neo4j Community Edition:

      curl -O https://dist.neo4j.org/rpm/neo4j-4.4.34-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

Performing an offline installation

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.

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.

Starting the service automatically on system start

To enable Neo4j to start automatically on system boot, run the following command:

systemctl enable neo4j

Before starting up the database for the first time, it is recommended to use the set-initial-password command of neo4j-admin to define the password for the native user neo4j.

If the password is not set explicitly using this method, it will be set to the default password neo4j. In that case, you will be prompted to change the default password at first login.

For more information, see Set an initial password.

For more information on operating the Neo4j system service, see Neo4j system service.

Uninstall Neo4j

Follow these steps to uninstall Neo4j:

  1. (Optional) Create a backup to avoid losing your data.

  2. Uninstall Neo4j:

    ---
    sudo yum remove neo4j
    ---