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

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

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.1 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.1.12, 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.1.12.

  3. Install Neo4j.

    • To install Neo4j Community Edition as root:

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

      yum install neo4j-enterprise-4.1.12

      If you are installing a milestone, alpha, beta, or release candidate release, the name of the package is neo4j-enterprise-<version>-0.<release>.1. For example, Neo4j Enterprise Edition Milestone Release 3 would be: neo4j-enterprise-4.0.0-0.beta03mr03.1

  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

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

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

      zypper install neo4j-enterprise-4.1.12

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

      curl -O https://dist.neo4j.org/rpm/neo4j-4.1.12-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, followed by Neo4j:

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

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.

  • 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
    ---