zzh@ZZHPC:~/Downloads/sfw$ sudo dpkg -i neo4j-enterprise_2025.01.0_all.deb (Reading database ... 403875 files and directories currently installed.) Preparing to unpack neo4j-enterprise_2025.01.0_all.deb ... license has already been accepted Unpacking neo4j-enterprise (1:2025.01.0) over (1:2025.01.0) ... dpkg: dependency problems prevent configuration of neo4j-enterprise: neo4j-enterprise depends on daemon; however: Package daemon is not installed. neo4j-enterprise depends on java21-runtime | jdk-21; however: Package java21-runtime is not installed. Package jdk-21 is not installed. neo4j-enterprise depends on cypher-shell (>= 1:2025.01.0); however: Package cypher-shell is not installed. neo4j-enterprise depends on cypher-shell (<< 2:0.0.0); however: Package cypher-shell is not installed. dpkg: error processing package neo4j-enterprise (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.10.2-1) ... Errors were encountered while processing: neo4j-enterprise
zzh@ZZHPC:~/Downloads/sfw$ sudo apt install daemon Reading package lists... Done Building dependency tree... Done Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: neo4j-enterprise : Depends: java21-runtime or jdk-21 but it is not installable Depends: cypher-shell (>= 1:2025.01.0) but it is not installable Depends: cypher-shell (< 2:0.0.0) but it is not installable E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
zzh@ZZHPC:~/Downloads/sfw$ sudo apt --fix-broken install Reading package lists... Done Building dependency tree... Done Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: openjdk-21-jre openjdk-21-jre-headless Suggested packages: fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei | fonts-wqy-zenhei The following packages will be REMOVED: neo4j-enterprise The following NEW packages will be installed: openjdk-21-jre openjdk-21-jre-headless 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. Need to get 47.0 MB of archives. After this operation, 254 MB disk space will be freed. Do you want to continue? [Y/n] Y Get:1 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 openjdk-21-jre-headless amd64 21.0.6+7-1~22.04.1 [46.8 MB] Get:2 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 openjdk-21-jre amd64 21.0.6+7-1~22.04.1 [233 kB] Fetched 47.0 MB in 26s (1,827 kB/s) (Reading database ... 403875 files and directories currently installed.) Removing neo4j-enterprise (1:2025.01.0) ... Selecting previously unselected package openjdk-21-jre-headless:amd64. (Reading database ... 403400 files and directories currently installed.) Preparing to unpack .../openjdk-21-jre-headless_21.0.6+7-1~22.04.1_amd64.deb ... Unpacking openjdk-21-jre-headless:amd64 (21.0.6+7-1~22.04.1) ... Selecting previously unselected package openjdk-21-jre:amd64. Preparing to unpack .../openjdk-21-jre_21.0.6+7-1~22.04.1_amd64.deb ... Unpacking openjdk-21-jre:amd64 (21.0.6+7-1~22.04.1) ... Setting up openjdk-21-jre-headless:amd64 (21.0.6+7-1~22.04.1) ... update-alternatives: using /usr/lib/jvm/java-21-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode update-alternatives: using /usr/lib/jvm/java-21-openjdk-amd64/bin/jpackage to provide /usr/bin/jpackage (jpackage) in auto mode update-alternatives: using /usr/lib/jvm/java-21-openjdk-amd64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode update-alternatives: using /usr/lib/jvm/java-21-openjdk-amd64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode update-alternatives: using /usr/lib/jvm/java-21-openjdk-amd64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode Setting up openjdk-21-jre:amd64 (21.0.6+7-1~22.04.1) ... Processing triggers for desktop-file-utils (0.26-1ubuntu3) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for gnome-menus (3.36.0-1ubuntu3) ... Processing triggers for man-db (2.10.2-1) ... Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
zzh@ZZHPC:~/Downloads/sfw$ sudo dpkg -i neo4j-enterprise_2025.01.0_all.deb Selecting previously unselected package neo4j-enterprise. (Reading database ... 403728 files and directories currently installed.) Preparing to unpack neo4j-enterprise_2025.01.0_all.deb ... license has already been accepted Unpacking neo4j-enterprise (1:2025.01.0) ... dpkg: dependency problems prevent configuration of neo4j-enterprise: neo4j-enterprise depends on daemon; however: Package daemon is not installed. neo4j-enterprise depends on cypher-shell (>= 1:2025.01.0); however: Package cypher-shell is not installed. neo4j-enterprise depends on cypher-shell (<< 2:0.0.0); however: Package cypher-shell is not installed. dpkg: error processing package neo4j-enterprise (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.10.2-1) ... Errors were encountered while processing: neo4j-enterprise
zzh@ZZHPC:~/Downloads/sfw$ sudo apt --fix-broken install Reading package lists... Done Building dependency tree... Done Reading state information... Done Correcting dependencies... Done The following packages will be REMOVED: neo4j-enterprise 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 457 MB disk space will be freed. Do you want to continue? [Y/n] Y (Reading database ... 404203 files and directories currently installed.) Removing neo4j-enterprise (1:2025.01.0) ... Processing triggers for man-db (2.10.2-1) ...
Dealing with multiple installed Java versions
You must configure your default Java version to point to Java 21, or Neo4j 2025.01.0 will be unable to start. Do so with the update-java-alternatives
command.
-
List all your installed versions of Java with
update-java-alternatives --list
.Your results may vary, but this is an example of the output:
java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64 java-1.17.0-openjdk-amd64 1711 /usr/lib/jvm/java-1.17.0-openjdk-amd64
-
Identify your Java 21 version from the list of installed javas. In this case, it is
java-1.21.0-openjdk-amd64
. -
Set Java 21 as the default by replacing
<java21name>
with its name:sudo update-java-alternatives --jre --set <java21name>
-
Confirm which version of Java is the default using
java -version
.
zzh@ZZHPC:~$ update-java-alternatives --list java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64 java-1.21.0-openjdk-amd64 2111 /usr/lib/jvm/java-1.21.0-openjdk-amd64 zzh@ZZHPC:~$ java --version openjdk 21.0.6 2025-01-21 OpenJDK Runtime Environment (build 21.0.6+7-Ubuntu-122.04.1) OpenJDK 64-Bit Server VM (build 21.0.6+7-Ubuntu-122.04.1, mixed mode, sharing)
Installation
Add the repository
The Debian package is available from https://debian.neo4j.com.
-
To add the Neo4j repository to the package manager, run the following as a sudo user:
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/neotechnology.gpg echo 'deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list sudo apt-get update
-
Once the repository has been added to
apt
, you can verify which Neo4j versions are available by running:apt list -a neo4j
In Ubuntu server installations, you also need to make sure that the
universe
repository is enabled. If theuniverse
repository is not present, the Neo4j installation will fail with the errorDepends: daemon but it is not installable
.This can be fixed by running the command:
sudo add-apt-repository universe
Install Neo4j
To install Neo4j, run one of the following commands depending on which version you want to install:
-
Neo4j Community Edition:
sudo apt-get install neo4j=1:2025.01.0
-
Neo4j Enterprise Edition:
sudo apt-get install neo4j-enterprise=1:2025.01.0
Note that the version includes an epoch version component (1:
), following the Debian policy on versioning.
When installing Neo4j Enterprise Edition, you will be prompted to accept the license agreement. Once the license agreement is accepted installation begins. Your answer to the license agreement prompt will be remembered for future installations on the same system.
To forget the stored answer, and trigger the license agreement prompt on subsequent installation, use debconf-communicate
to purge the stored answer:
echo purge | sudo debconf-communicate neo4j-enterprise
zzh@ZZHPC:~$ sudo wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/neotechnology.gpg echo 'deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list sudo apt-get update Redirecting output to ‘wget-log’. deb [signed-by=/etc/apt/keyrings/neotechnology.gpg] https://debian.neo4j.com stable latest Get:1 file:/var/cuda-repo-ubuntu2204-12-4-local InRelease [1,572 B] Get:2 file:/var/cudnn-local-repo-ubuntu2204-9.4.0 InRelease [1,572 B] Get:1 file:/var/cuda-repo-ubuntu2204-12-4-local InRelease [1,572 B] Get:2 file:/var/cudnn-local-repo-ubuntu2204-9.4.0 InRelease [1,572 B] Get:3 https://packages.microsoft.com/repos/code stable InRelease [3,590 B] Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB] Get:5 https://packages.microsoft.com/repos/code stable/main amd64 Packages [17.4 kB] Get:6 https://packages.microsoft.com/repos/code stable/main arm64 Packages [17.5 kB] Get:7 https://packages.microsoft.com/repos/code stable/main armhf Packages [17.6 kB] Get:8 https://esm.ubuntu.com/apps/ubuntu jammy-apps-security InRelease [7,565 B] Get:11 https://esm.ubuntu.com/apps/ubuntu jammy-apps-updates InRelease [7,456 B] Hit:9 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease Get:12 https://esm.ubuntu.com/infra/ubuntu jammy-infra-security InRelease [7,450 B] Get:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease [128 kB] Get:13 https://esm.ubuntu.com/infra/ubuntu jammy-infra-updates InRelease [7,449 B] Get:14 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,079 kB] Hit:15 https://dl.google.com/linux/chrome/deb stable InRelease Get:16 https://debian.neo4j.com stable InRelease [44.2 kB] Get:17 https://debian.neo4j.com stable/latest i386 Packages [819 B] Get:18 https://debian.neo4j.com stable/latest amd64 Packages [819 B] Fetched 2,468 kB in 8s (308 kB/s) Reading package lists... Done zzh@ZZHPC:~$ apt list -a neo4j Listing... Done neo4j/stable,stable 1:2025.01.0 all zzh@ZZHPC:~$ sudo apt-get install neo4j-enterprise=1:2025.01.0 Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: cypher-shell daemon The following NEW packages will be installed: cypher-shell daemon neo4j-enterprise 0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded. Need to get 457 MB of archives. After this operation, 501 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 daemon amd64 0.8-1 [60.9 kB] Get:2 https://debian.neo4j.com stable/latest amd64 cypher-shell all 1:2025.01.0 [38.8 MB] Get:3 https://debian.neo4j.com stable/latest amd64 neo4j-enterprise all 1:2025.01.0 [419 MB] Fetched 457 MB in 4min 1s (1,902 kB/s) Preconfiguring packages ... Selecting previously unselected package daemon. (Reading database ... 403728 files and directories currently installed.) Preparing to unpack .../daemon_0.8-1_amd64.deb ... Unpacking daemon (0.8-1) ... Selecting previously unselected package cypher-shell. Preparing to unpack .../cypher-shell_1%3a2025.01.0_all.deb ... Unpacking cypher-shell (1:2025.01.0) ... Selecting previously unselected package neo4j-enterprise. Preparing to unpack .../neo4j-enterprise_1%3a2025.01.0_all.deb ... Unpacking neo4j-enterprise (1:2025.01.0) ... Setting up cypher-shell (1:2025.01.0) ... Setting up daemon (0.8-1) ... Setting up neo4j-enterprise (1:2025.01.0) ... Adding system user `neo4j' (UID 132) ... Adding new user `neo4j' (UID 132) with group `neo4j' ... Not creating home directory `/var/lib/neo4j'. Processing triggers for man-db (2.10.2-1) ...
Offline installation
If you cannot reach https://debian.neo4j.com
, perhaps due to a firewall, you need to obtain Neo4j via an alternative machine that has the relevant access, and then move the package manually.
It is important to note that using this method will mean that the offline machine will not receive the dependencies that are normally downloaded and installed automatically when using
|
File locations
File locations for all Neo4j packages are documented here.
Default file locations
Bin: /usr/bin
Certificates: /var/lib/neo4j/certificates
Configuration:
/etc/neo4j/neo4j.conf
/etc/neo4j/neo4j-admin.conf
/etc/neo4j/server-logs.xml
/etc/neo4j/user-log.xml
Data: /var/lib/neo4j/data
Import: /var/lib/neo4j/import
Labs: /var/lib/neo4j/labs (The labs directory contains APOC Core)
Lib: /usr/share/neo4j/lib (The lib directory contains all Neo4j dependencies)
Licenses: /var/lib/neo4j/licenses
Logs: /var/log/neo4j/ (To view the neo4j.log for Debian and RPM, use journalctl --unit=neo4j
)
Metrics: /var/lib/neo4j/metrics
Plugins: /var/lib/neo4j/plugins
Products: /var/lib/neo4j/products
Run: /var/lib/neo4j/run
Customize your file locations
The file locations can also be customized by using environment variables and options.
The locations of <NEO4J_HOME> and conf can be configured using environment variables:
Location | Default | Environment variable | Notes |
---|---|---|---|
<NEO4J_HOME> |
parent of bin |
|
Must be set explicitly if bin is not a subdirectory. |
conf |
<NEO4J_HOME>/conf |
|
Must be set explicitly if it is not a subdirectory of <NEO4J_HOME>. |
The rest of the locations can be configured by uncommenting the respective setting in the conf/neo4j.conf file and changing the default value.
#server.directories.data=data #server.directories.plugins=plugins #server.directories.logs=logs #server.directories.lib=lib #server.directories.run=run #server.directories.licenses=licenses #server.directories.metrics=metrics #server.directories.transaction.logs.root=data/transactions #server.directories.dumps.root=data/dumps #server.directories.import=import
Operation
Most Neo4j configuration goes into neo4j.conf.
For operating systems using systemd
, some package-specific options are set in neo4j.service and can be edited using systemctl edit neo4j.service
.
For operating systems that are not using systemd
, some package-specific options are set in /etc/default/neo4j.
Environment variable | Default value | Details |
---|---|---|
NEO4J_SHUTDOWN_TIMEOUT |
120 |
Timeout in seconds when waiting for Neo4j to stop. 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. |
NEO4J_ULIMIT_NOFILE |
60000 |
Maximum number of file handles that can be opened by the Neo4j process. |
Starting the service automatically on system start
On Debian-based distributions, run the following command to ensure that Neo4j starts automatically at boot time:
sudo systemctl enable neo4j
Before starting up the database for the first time, it is recommended to use the If the password is not set explicitly using this method, it will be set to the default password For more information, see Set an initial password. |
For more information on operating the Neo4j system service, see Neo4j system service.
zzh@ZZHPC:~$ sudo systemctl status neo4j ○ neo4j.service - Neo4j Graph Database Loaded: loaded (/lib/systemd/system/neo4j.service; disabled; vendor preset: enabled) Active: inactive (dead) zzh@ZZHPC:~$ sudo systemctl start neo4j zzh@ZZHPC:~$ sudo systemctl status neo4j ● neo4j.service - Neo4j Graph Database Loaded: loaded (/lib/systemd/system/neo4j.service; disabled; vendor preset: enabled) Active: active (running) since Mon 2025-02-17 21:17:31 CST; 15s ago Main PID: 23564 (java) Tasks: 122 (limit: 18907) Memory: 681.8M CPU: 15.487s CGroup: /system.slice/neo4j.service ├─23564 /usr/bin/java -Xmx128m -classpath "/usr/share/neo4j/lib/*:/usr/share/neo4j/etc:/usr/share/neo4j/repo/*" -Dapp.name=neo4j -Dapp.pid=23564 -Dapp.> └─23596 /usr/lib/jvm/java-21-openjdk-amd64/bin/java -cp "/var/lib/neo4j/plugins/*:/etc/neo4j/*:/usr/share/neo4j/lib/*" -XX:+UseG1GC -XX:-OmitStackTrace> Feb 17 21:17:37 ZZHPC neo4j[23596]: 2025-02-17 13:17:37.395+0000 INFO Sending metrics to CSV file at /var/lib/neo4j/metrics Feb 17 21:17:37 ZZHPC neo4j[23596]: 2025-02-17 13:17:37.418+0000 INFO Anonymous Usage Data is being sent to Neo4j, see https://neo4j.com/docs/usage-data/ Feb 17 21:17:37 ZZHPC neo4j[23596]: 2025-02-17 13:17:37.422+0000 INFO Bolt enabled on localhost:7687. Feb 17 21:17:37 ZZHPC neo4j[23596]: 2025-02-17 13:17:37.424+0000 INFO Bolt (Routing) enabled on localhost:7688. Feb 17 21:17:38 ZZHPC neo4j[23596]: 2025-02-17 13:17:38.141+0000 INFO HTTP enabled on localhost:7474. Feb 17 21:17:38 ZZHPC neo4j[23596]: 2025-02-17 13:17:38.141+0000 INFO Remote interface available at http://localhost:7474/ Feb 17 21:17:38 ZZHPC neo4j[23596]: 2025-02-17 13:17:38.143+0000 INFO id: 69C8C559B072E2F91B571E0FB93EA29A279CBBDF11B66B6079BA4E0AC29006CB Feb 17 21:17:38 ZZHPC neo4j[23596]: 2025-02-17 13:17:38.143+0000 INFO name: system Feb 17 21:17:38 ZZHPC neo4j[23596]: 2025-02-17 13:17:38.143+0000 INFO creationDate: 2025-02-17T13:17:36.397Z Feb 17 21:17:38 ZZHPC neo4j[23596]: 2025-02-17 13:17:38.143+0000 INFO Started.
Uninstall Neo4j
Follow these steps to uninstall Neo4j:
-
(Optional) Create a backup to avoid losing your data.
-
Uninstall Neo4j:
--- sudo apt remove neo4j ---
4. Download Drivers
You've already seen the Neo4j Browser - which is your developer interface to the Neo4j graph database. Now it's time to write code in your favorite programming language so you can start building your application.
Get the official drivers for Javascript, Java, .NET, and Python
Additionally, the community has built a wide variety of other drivers in languages like PHP, Ruby, Go, Haskell and more.
5. Create Your Data Model
Creating Your First Data Model
Start with a small data model and then build out from there - Neo4j is naturally adaptive, so you can add new node labels, relationships and properties on the fly.
Example Data Models
The developer community has provided example data models and queries for a variety of use cases outlined in Neo4j GraphGists.
Data Import
Do you have some existing data you'd like to import? You can import your data from CSV files using the Cypher's LOAD CSV command. Learn more about import in the Neo4j Developer Manual: Load CSV and Importing CSV Data into Neo4j.
Of course, Neo4j believes in polyglot persistence as well - so we're happy if Neo4j is just one part of your overall architecture and storing your connected data, while your columnar, tabular and document data is stored elsewhere. Learn more about the various types of data integrations possible with Neo4j.
6. Get Help and Training
Training
- Take Online Training: Introduction to Graph Databases and Neo4j
- Attend GraphAcademy Neo4j training at a city near you
- Watch Video Series: Intro to Graph Databases
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· DeepSeek “源神”启动!「GitHub 热点速览」
· 我与微信审核的“相爱相杀”看个人小程序副业
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
· 上周热点回顾(2.17-2.23)