Linux tarball installation

This section describes how to install Neo4j on Linux from a tarball, and run it as a console application or service.

1. Unix console application

  1. Download the latest release from Neo4j Download Center.

    Select the appropriate tar.gz distribution for your platform.

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

  3. Extract the contents of the archive, using tar -xf <filename>

    Refer to the top-level extracted directory as: NEO4J_HOME

  4. Change directory to: $NEO4J_HOME

    Run ./bin/neo4j console

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

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

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

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

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