环境:neo4j 5 + ubuntu22 + openjdk-17
neo4j 5 对 jre 版本要求是 17 及以上,且最好是 openjdk,使用比较新的 ubuntu 系统安装比较好, centos7 因为没有维护,yum 找不到 openjdk-17了。
官方的 debian 系列安装教程:Debian-based distributions (.deb) - Operations Manual
安装 openjdk-17:
apt-get update
apt-get upgradeapt-get -y install openjdk-17-jdk openjdk-17-dbg openjdk-17-jre
java -version
添加 neo4j 的仓库
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo add-apt-repository universe
安装 neo4j
# apt list -a neo4j #显示 neo4j 各个版本,选择自己需要的
sudo apt-get install neo4j=1:5.5.0 # 选择 5.5 版本
安装成功后
设置初始密码, "
neo4j-admin dbms set-initial-password
修改 neo4j 监听地址:
找到 neo4j 的配置文件,将服务监听地址改成全局地址
vi /etc/neo4j/neo4j.conf
取消掉如下 3 行的注释,保存配置文件
server.default_listen_address=0.0.0.0server.http.listen_address=:7474
server.http.advertised_address=:7474
启动 neo4j 服务
systemctl start neo4j.service
ss -ntlp 看到 neo4j 监听端口,说明启动成功了
访问 http://you_IP:7474,输入账号 neo4j 以及自己设置的密码,就可以登录了。