Linux tarball installation

Before you install Neo4j on Linux from a tarball and run it as a console application or service, check System Requirements to see if your setup is suitable.

Unix console application

  1. If it is not already installed, get OpenJDK 17 or Oracle Java 17.

  2. Download the latest release from Neo4j Download Center.

    Select the appropriate tar.gz distribution for your platform.

  3. Make sure to download Neo4j from Neo4j Download Center and always check that the SHA hash of the downloaded file is correct:

    1. To find the correct SHA hash, go to Neo4j Download Center and click on SHA-256 which will be located below your downloaded file.

    2. Using the appropriate commands for your platform, display the SHA-256 hash for the file that you downloaded.

    3. Ensure that the two are identical.

  4. Extract the contents of the archive, using tar -xf <filename>. For example, tar -xf neo4j-community-5.2.0-unix.tar.gz.

  5. Place the extracted files in a permanent home on your server. The top level directory is referred to as NEO4J_HOME.

    1. To run Neo4j as a console application, use: <NEO4J_HOME>/bin/neo4j console.

    2. To run Neo4j in a background process, use: <NEO4J_HOME>/bin/neo4j start.

  6. Visit http://localhost:7474 in your web browser.

  7. Connect using the username 'neo4j' with default password 'neo4j'. You’ll then be prompted to change the password.

  8. Stop the server by typing Ctrl-C in the console.

Linux service

If you want to run Neo4j as a system service, you can install either the Debian or RPM package.

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

Setting the number of open files

Linux platforms impose an upper limit on the number of concurrently open files per user and session. To check your limit for the current session, run the command ulimit -n. The default value is 1024.

user@localhost:~$ ulimit -n
1024

However, if you experience exceptions on Too many open files or Could not stat() directory, you have to increase the limit to 40000 or more, depending on your usage patterns. This is especially true when many indexes are used, or the server installation sees too many open network connections or sockets.

A quick solution is the command ulimit -n <the-new-limit>, but it will set a new limit only for the root user and will affect only the current session. If you want to set the value system-wide, follow the instructions for your platform.

The following steps set the open file descriptor limit to 60000 for the user neo4j under Ubuntu 16.04 LTS, Debian 8, CentOS 7, or later versions.

Running Neo4j as a service

  1. Open the neo4j.service file with root privileges.

    user@localhost:~$ sudo systemctl edit neo4j.service
  2. Append the [Service] section to the neo4j.service file.

    [Service]
    LimitNOFILE=60000

Running Neo4j as an interactive user (e.g., for testing purposes)

  1. Open the user.conf file with root privileges in a text editor, for example, Vim.

    user@localhost:~$ sudo vi /etc/systemd/user.conf
  2. Uncomment and define the value of DefaultLimitNOFILE, found in the [Manager] section.

    [Manager]
    ...
    DefaultLimitNOFILE=60000
  3. Open the /etc/security/limits.conf file.

    user@localhost:~$ sudo vi /etc/security/limits.conf
  4. Define the following values:

    neo4j	soft	nofile	60000
    neo4j	hard	nofile	60000
  5. Reload the systemd settings.

    user@localhost:~$ sudo systemctl daemon-reload
  6. Reboot your machine.