Setting up Neo4j Enterprise Edition Linux Five - tomgeudens/practical-neo4j GitHub Wiki

Disclaimer: This document aims at getting a Neo4j database up-and-running in the context of a training or experiment. It is not fit for production installation purposes. It also assumes a single user single machine developer installation and is in that respect similar to a Neo4j Desktop installation (which also provides the Enterprise Edition). For that purpose the Neo4j Enterprise Edition software requires no further licensing. For any other purpose ... it does !

Version: this document is current for version 5.26.5

Last Update: 2025/04/03 - Neo4j 5.26.5

One - Location Location Location

This document will assume everything (software, installation, database) is going to happen in a single neo4j folder (which is created below). This folder must reside in a location that is writable for the user with which you are logged on. No elevated rights will be needed (and try to avoid using root). The /home/ folder is perfect.

<user>@<machine>:~$
<user>@<machine>:~$ mkdir neo4j
<user>@<machine>:~$ mkdir neo4j/scripts
<user>@<machine>:~$ cd neo4j
<user>@<machine>:~/neo4j$

Everything that follows will assume that you are positioned in the neo4j folder !

Now, six scripts need to be put in the scripts folder. You can download these from here :

<user>@<machine>:~/neo4j$ wget -O "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/version.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/download.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/unpack.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/move.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/settings.sh
<user>@<machine>:~/neo4j$ wget -O "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/environment.sh

Do verify the sizes match up ...

<user>@<machine>:~/neo4j$ ls -l scripts/
...  587 ... download.sh
...  219 ... environment.sh
...  215 ... move.sh
... 3104 ... settings.sh
...  248 ... unpack.sh
...  195 ... version.sh

Two - Downloading the softwares

In this step a subfolder install will be created and the following softwares will be put into it :

What Location
Java JRE install/OpenJDK17U-jre_x64_linux_hotspot_17.0.14_7.tar.gz
Neo4j Enterprise Server install/neo4j-enterprise-5.26.5-unix.tar.gz
GDS library install/neo4j-graph-data-science-2.13.3.zip

The instructions below will use a simple script to accomplish this. Note that this is one of the scripts you downloaded earlier.

<user>@<machine>:~/neo4j$ sh -x scripts/download.sh
<user>@<machine>:~/neo4j$ ls -l install/
... 448024076 ... neo4j-enterprise-5.26.5-unix.tar.gz
...  56594489 ... neo4j-graph-data-science-2.13.3.zip
...  46092700 ... OpenJDK17U-jre_x64_linux_hotspot_17.0.14_7.tar.gz

Do check that the sizes match with yours !

Three - Unpacking the softwares

In this step, everything that is compressed will be unpacked. Typically that's the Neo4j software, the Java software and the Graph Data Science zip.

<user>@<machine>:~/neo4j$ sh -x scripts/unpack.sh
+ tar -xzf install/OpenJDK17U-jre_x64_linux_hotspot_17.0.14_7.tar.gz
+ tar -xzf install/neo4j-enterprise-5.26.5-unix.tar.gz
+ unzip -q install/neo4j-graph-data-science-2.13.3.zip -d install

<user>@<machine>:~/neo4j$ ls -l
... install
... jdk-17.0.14+7-jre
... neo4j-enterprise-5.26.5
... scripts

Four - Move plugins in place

With all the plugins now in jar form, it's time to move them into the plugins folder.

<user>@<machine>:~/neo4j$ sh -x scripts/move.sh
+ mv neo4j-enterprise-5.26.5/labs/apoc-5.26.5-core.jar neo4j-enterprise-5.26.5/plugins
+ mv install/neo4j-graph-data-science-2.13.3.jar neo4j-enterprise-5.26.5/plugins

And verify that things match up ...

<user>@<machine>:~/neo4j$ ls -l neo4j-enterprise-5.26.5/plugins/
...  2965368 ... apoc-5.26.5-core.jar
... 64058873 ... neo4j-graph-data-science-2.13.3.jar
...     2217 ... README.txt

With that done, it’s time for some basic customization ...

Five - Settings

Most of the default settings of Neo4j are fine for the purposes of a training or experimentation, but not all. The script below (that you downloaded earlier) fixes what needs fixing and also sets the initial password for the database to morpheus. Alternatively you can also modify the neo4j.conf and apoc.conf files manually, the statement shows all the changes you need to make.

<user>@<machine>:~/neo4j$ sh -x scripts/settings.sh
Changed password for user 'neo4j'. IMPORTANT: this change will only take effect if performed before the database is started for the first time.

<user>@<machine>:~/neo4j$ tail -n 25 neo4j-enterprise-5.26.5/conf/neo4j.conf
# Custom - Generic
server.config.strict_validation.enabled=false
# Custom - Metrics
server.metrics.enabled=true
server.metrics.filter=*
server.metrics.csv.enabled=false
server.metrics.prometheus.enabled=false
server.metrics.graphite.enabled=false
server.metrics.jmx.enabled=true
# Custom - Query Log
db.logs.query.enabled=OFF
# Custom - Miscellaneous
dbms.db.timezone=SYSTEM
dbms.security.procedures.unrestricted=apoc*,gds*
browser.remote_content_hostname_whitelist=*
# Custom - Memory
server.memory.heap.initial_size=2g
server.memory.heap.max_size=2g
server.memory.pagecache.size=1g
dbms.memory.transaction.total.max=2000m
db.memory.transaction.max=1g
# Custom - Network Settings
server.default_listen_address=0.0.0.0
# no usage data collection please
dbms.usage_report.enabled=false

<user>@<machine>:~/neo4j$ cat neo4j-enterprise-5.26.5/conf/apoc.conf
apoc.export.file.enabled=true
apoc.import.file.enabled=true
apoc.import.file.use_neo4j_config=true

Ready to start now ...

Six - Starting

We are going to be running the database in console mode. That means that the command we are going to issue will continue running in the foreground (so do not close the shell unless you want to bring down the database). An important thing here is that you need to have the correct (17 for Neo4j 5.x.x) Java environment. And the final script you downloaded earlier does just that ...

<user>@<machine>:~/neo4j$ . ./scripts/environment.sh
<user>@<machine>:~/neo4j$ echo $JAVA_HOME
<yourlocation>/neo4j/jdk-17.0.14+7-jre
<user>@<machine>:~/neo4j$ neo4j-enterprise-5.26.5/bin/neo4j console
Directories in use:
home:         /home/<user>/neo4j-enterprise-5.26.5
config:       /home/<user>/neo4j-enterprise-5.26.5/conf
logs:         /home/<user>/neo4j-enterprise-5.26.5/logs
plugins:      /home/<user>/neo4j-enterprise-5.26.5/plugins
import:       /home/<user>/neo4j-enterprise-5.26.5/import
data:         /home/<user>/neo4j-enterprise-5.26.5/data
certificates: /home/<user>/neo4j-enterprise-5.26.5/certificates
licenses:     /home/<user>/neo4j-enterprise-5.26.5/licenses
run:          /home/<user>/neo4j-enterprise-5.26.5/run
Starting Neo4j.
2025-04-03 15:29:18.167+0000 INFO  Logging config in use: File '/home/<user>/neo4j/neo4j-enterprise-5.26.5/conf/user-logs.xml'
2025-04-03 15:29:18.173+0000 INFO  The license agreement was accepted with environment variable NEO4J_ACCEPT_LICENSE_AGREEMENT=yes when the Software was started.


2025-04-03 15:29:18.193+0000 INFO  Starting...
2025-04-03 15:29:19.758+0000 INFO  ======== Neo4j 5.26.5 ========
2025-04-03 15:29:19.769+0000 INFO  This instance is ServerId{xxxxxxxx} (xxxxxxxx-yyyy-zzzz-aaaa-bbbbbbbbbbbb)
2025-04-03 15:29:19.790+0000 INFO  GDS license file: null
2025-04-03 15:29:19.790+0000 INFO  GDS license state: unlicensed
2025-04-03 15:29:19.791+0000 INFO  Prometheus: disabled
2025-04-03 15:29:19.796+0000 WARN  GDS metrics disabled
2025-04-03 15:29:19.799+0000 INFO  Progress tracking: enabled
2025-04-03 15:29:19.799+0000 INFO  Memory usage guard: minimum estimate
2025-04-03 15:29:19.801+0000 INFO  Register GDS Memory Facade...
2025-04-03 15:29:19.802+0000 INFO  GDS Memory Facade registered.
2025-04-03 15:29:19.814+0000 INFO  Building Graph Data Science extension...
2025-04-03 15:29:19.815+0000 INFO  Register Graph Data Science...
2025-04-03 15:29:19.816+0000 INFO  Graph Data Science registered.
2025-04-03 15:29:19.816+0000 INFO  Register Metrics...
2025-04-03 15:29:19.817+0000 INFO  Metrics registered.
2025-04-03 15:29:19.817+0000 INFO  Register Model Catalog...
2025-04-03 15:29:19.817+0000 INFO  Model Catalog registered.
2025-04-03 15:29:19.818+0000 INFO  Register Task Registry Factory...
2025-04-03 15:29:19.818+0000 INFO  Task Registry Factory registered.
2025-04-03 15:29:19.818+0000 INFO  Register Task Store...
2025-04-03 15:29:19.819+0000 INFO  Task Store registered.
2025-04-03 15:29:19.819+0000 INFO  Register User Log Registry Factory...
2025-04-03 15:29:19.819+0000 INFO  User Log Registry Factory registered.
2025-04-03 15:29:19.819+0000 INFO  Graph Data Science extension built.
2025-04-03 15:29:19.820+0000 INFO  Building Graph Data Science Extras extension...
2025-04-03 15:29:19.820+0000 INFO  Register Graph Data Science Extras...
2025-04-03 15:29:19.821+0000 INFO  Graph Data Science Extras registered.
2025-04-03 15:29:19.821+0000 INFO  Graph Data Science Extras extension built.
2025-04-03 15:29:20.026+0000 INFO  Resolved endpoints with LIST{endpoints:'[localhost:5000]'} to '[localhost:5000]'
2025-04-03 15:29:20.657+0000 INFO  Resolved endpoints with LIST{endpoints:'[localhost:5000]'} to '[localhost:5000]'
2025-04-03 15:29:21.772+0000 INFO  Default database 'neo4j' is created
2025-04-03 15:29:28.918+0000 INFO  Bolt enabled on 0.0.0.0:7687.
2025-04-03 15:29:28.937+0000 INFO  Bolt (Routing) enabled on 0.0.0.0:7688.
2025-04-03 15:29:29.529+0000 INFO  HTTP enabled on 0.0.0.0:7474.
2025-04-03 15:29:29.530+0000 INFO  Remote interface available at http://localhost:7474/
2025-04-03 15:29:29.531+0000 INFO  id: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
2025-04-03 15:29:29.531+0000 INFO  name: system
2025-04-03 15:29:29.531+0000 INFO  creationDate: 2025-04-03T17:29:21.097+02:00
2025-04-03 15:29:29.531+0000 INFO  Started.

Enjoy!

Appendix - Just the commands

The observation has been made that it can be hard to correctly cut-and-paste the commands from in between the output and the explanation. Below you'll therefore find just the necessary commands.

Setup

The assumption is that you have positioned yourself in the location where the self-contained setup needs to go

mkdir neo4j
mkdir neo4j/scripts
cd neo4j
wget -O "scripts/version.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/version.sh
wget -O "scripts/download.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/download.sh
wget -O "scripts/unpack.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/unpack.sh
wget -O "scripts/move.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/move.sh
wget -O "scripts/settings.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/settings.sh
wget -O "scripts/environment.sh" https://raw.githubusercontent.com/tomgeudens/practical-neo4j/master/scripts/fiveohandbeyond/linux/environment.sh

Installation

The assumption is that you have positioned yourself in the neo4j folder (created in Setup)

sh -x scripts/download.sh
sh -x scripts/unpack.sh
sh -x scripts/move.sh
sh -x scripts/settings.sh

Running

Whereas Setup and Installation are only executed once, this one is repeated every time you want to start the database. The assumption is that you have positioned yourself in the neo4j folder (created in Setup)

. ./scripts/environment.sh
neo4j-enterprise-5.26.5/bin/neo4j console
⚠️ **GitHub.com Fallback** ⚠️