Neo4j system service

This page covers configuring and operating the Neo4j system service. It assumes that your system has systemd, which is the case for most Linux distributions.

Setting the number of open files.

For instructions on how to set the number of concurrent files that a user can have open, see Setting the number of open files.

Configuration

Configuration is stored in /etc/neo4j/neo4j.conf. See Default file locations for a complete catalog of where files are found for the various packages.

Controlling the service

System services are controlled with the systemctl command. It accepts a number of commands:

systemctl {start|stop|restart} neo4j

Service customizations can be placed in a service override file. To edit your specific options, do the following command which will open up an editor of the appropriate file:

systemctl edit neo4j

Then place any customizations under a [Service] section. The following example lists default values that may be interesting to change for some users:

[Service]
# The user and group which the service runs as.
User=neo4j
Group=neo4j
# 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.
TimeoutSec=120

You can print the effective service, including possible overrides, with:

systemctl cat neo4j

Remember to restart neo4j if you change any settings.

systemctl restart neo4j

Log

The neo4j log is written to journald which can be viewed using the journalctl command:

journalctl -e -u neo4j

journald automatically rotates the log after a certain time and by default it commonly does not persist across reboots. Please see man journald.conf for further details.

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