Debian-based distributions (.deb)

You can install Neo4j on Debian, and Debian-based distributions like Ubuntu, using the Neo4j Debian package.

Java prerequisites

Neo4j 5 requires the Java 17 runtime. Java 17 is not included in Ubuntu 16.04 LTS and will have to be set up manually before installing or upgrading to Neo4j 5, as described below. Debian 11 and Ubuntu 18.04 onwards already have the OpenJDK Java 17 package available through apt. From version 5.14 onwards, Neo4j also supports JDK 21.

Oracle JDK, Zulu JDK, or Corretto JDK

If you wish to use a non-default JDK, it must be installed before starting the Neo4j installation. Otherwise, your package manager will install the default Java distribution for your operating system, usually OpenJDK.

Download and installation instructions can be found on the manufacturer’s website:

OpenJDK 17 on Ubuntu 16.04

Add the official OpenJDK package repository to apt:

sudo add-apt-repository -y ppa:openjdk-r/ppa
sudo apt-get update

You are now ready to install Neo4j, which will install Java 17 automatically if it is not already installed. See Dealing with multiple installed Java versions to make sure you can start Neo4j after installation.

Dealing with multiple installed Java versions

You must configure your default Java version to point to Java 17, or Neo4j 5.20.0 will be unable to start. Do so with the update-java-alternatives command.

  1. List all your installed versions of Java with update-java-alternatives --list.

    Your results may vary, but this is an example of the output:

    java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64
    java-1.11.0-openjdk-amd64 1071 /usr/lib/jvm/java-1.11.0-openjdk-amd64
  2. Identify your Java 17 version:

    java -version

    In this case, it is java-1.17.0-openjdk-amd64.

  3. Set it as the default by replacing <java17name> with its name:

    sudo update-java-alternatives --jre --set <java17name>
  4. Confirm which version of Java is the default using java -version again.


Add the repository

The Debian package is available from

  1. To use the repository for generally available versions of Neo4j, run:

    wget -O - | sudo apt-key add -
    echo 'deb stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list
    sudo apt-get update

    To avoid the risk of the apt package manager accidentally forcing a database upgrade, different major and minor releases of Neo4j are also available separately inside the repository. To install Neo4j this way, specify the major and minor version required, in place of latest.

    The following method for production or business-critical installations is recommended:

    wget -O - | sudo apt-key add -
    echo 'deb stable 5' | sudo tee -a /etc/apt/sources.list.d/neo4j.list
    sudo apt-get update
  2. Once the repository has been added to apt, you can verify which Neo4j versions are available by running:

    apt list -a neo4j

    In Ubuntu server installations, you also need to make sure that the universe repository is enabled. If the universe repository is not present, the Neo4j installation will fail with the error Depends: daemon but it is not installable.

    This can be fixed by running the command:

    sudo add-apt-repository universe

Install Neo4j

To install Neo4j, run one of the following commands depending on which version you want to install:

  • Neo4j Community Edition:

    sudo apt-get install neo4j=1:5.20.0
  • Neo4j Enterprise Edition:

    sudo apt-get install neo4j-enterprise=1:5.20.0

Note that the version includes an epoch version component (1:), following the Debian policy on versioning.

When installing Neo4j Enterprise Edition, you will be prompted to accept the license agreement. Once the license agreement is accepted installation begins. Your answer to the license agreement prompt will be remembered for future installations on the same system.

To forget the stored answer, and trigger the license agreement prompt on subsequent installation, use debconf-communicate to purge the stored answer:

echo purge | sudo debconf-communicate neo4j-enterprise

Non-interactive installation of Neo4j Enterprise Edition

For Neo4j Enterprise Edition, the license agreement is presented in 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 using debconf-set-selections:

For Neo4j 5.3 and later
echo "neo4j-enterprise neo4j/accept-license select Accept commercial license" | sudo debconf-set-selections
For Neo4j 5.2 and earlier
echo "neo4j-enterprise neo4j/question select I ACCEPT" | sudo debconf-set-selections
echo "neo4j-enterprise neo4j/license note" | sudo debconf-set-selections

Verify the Java version

On newer Debian or Ubuntu operating systems, Java 19 is available by default, and apt may install OpenJDK 19, even if you have Java 17 installed.

If this happens, Neo4j will return the following warning on start:

WARNING! You are using an unsupported Java runtime.
* Please use Oracle(R) Java(TM) 17, OpenJDK(TM) 17 to run Neo4j.
* Please see for Neo4j installation instructions.

To fix this, you can install Java 17 manually and then either uninstall OpenJDK 19 or set Java 17 as the default.

  1. Run the following command to install OpenJDK 17 manually:

    sudo apt install openjdk-17-jre

    For other distributions of Java 17, see Java prerequisites.

  2. Choose one of the following options to set it as the default:

Offline installation

If you cannot reach, perhaps due to a firewall, you need to obtain Neo4j via an alternative machine that has the relevant access, and then move the 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 apt for installing Neo4j; Cypher Shell and Java (if not installed already):

  1. Run the following to download the required Debian software package:

    • Neo4j Enterprise Edition:

      curl -O

      To list all files that the Debian software package (.deb file) installs:

      dpkg --contents neo4j_5.20.0_all.deb
    • Neo4j Community Edition:

      curl -O
  2. Manually move the downloaded Debian package to the offline machine.

  3. Run the following on the offline machine to install Neo4j:

    sudo dpkg -i <deb file name>

File locations

File locations for all Neo4j packages are documented here.


Most Neo4j configuration goes into neo4j.conf.

For operating systems using systemd, some package-specific options are set in neo4j.service and can be edited using systemctl edit neo4j.service.

For operating systems that are not using systemd, some package-specific options are set in /etc/default/neo4j.

Environment variable Default value Details



Timeout in seconds when waiting for Neo4j to stop. If it takes longer than this then the shutdown is considered to have failed. This may need to be increased if the system serves long-running transactions.



Maximum number of file handles that can be opened by the Neo4j process.

Starting the service automatically on system start

On Debian-based distributions, run the following command to ensure that Neo4j starts automatically at boot time:

sudo 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 apt remove neo4j