2.3.4. Linux tarball installation

This section describes how to install Neo4j on Linux from a tarball, and run it as a console application or service. 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. Linux service

If you are interested in running Neo4j as a system service, please install one of our Debian or RPM packages instead. Setting the number of open files

Linux platforms impose an upper limit on the number of concurrent files a user may have open. This number is reported for the current user and session with the ulimit -n command:

user@localhost:~$ ulimit -n

The usual default of 1024 is often not enough. This is especially true when many indexes are used or a server installation sees too many connections. Network sockets count against the limit as well. Users are therefore encouraged to increase the limit to a healthy value of 40 000 or more, depending on usage patterns. It is possible to set the limit with the ulimit command, but only for the root user, and it only affects the current session. To set the value system wide, follow the instructions for your platform.

What follows is the procedure to set the open file descriptor limit to 40 000 for user neo4j under Ubuntu 10.04 and later.

If you opted to run the Neo4j service as a different user, change the first field in step 2 accordingly.

  1. Become root, since all operations that follow require editing protected system files.

    user@localhost:~$ sudo su -
  2. Edit /etc/security/limits.conf and add these two lines:

    neo4j	soft	nofile	40000
    neo4j	hard	nofile	40000
  3. Edit /etc/pam.d/su and uncomment or add the following line:

    session    required   pam_limits.so
  4. A restart is required for the settings to take effect.

    After the above procedure, the Neo4j user will have a limit of 40 000 simultaneous open files. If you continue experiencing exceptions on Too many open files or Could not stat() directory, you may have to raise the limit further.