How to Install Neo4j on Debian 12

Estimated reading: 4 minutes 111 views

Introduction

Neo4j is one of the most popular graph database management systems, designed to efficiently handle highly connected data. In Neo4j, data is represented using:

  • Nodes: entities (e.g., users, devices, accounts)
  • Relationships: connections between nodes, always typed and directed
  • Properties: key-value pairs attached to nodes or relationships

This model makes Neo4j especially powerful for use cases such as:

  • Fraud detection
  • Recommendation engines
  • Social networks
  • Identity and access management (IAM)
  • Knowledge graphs

Running Neo4j on Debian 12 (Bookworm) provides a secure and stable long-term supported (LTS) environment. Debian 12 includes the Linux 6.1+ kernel, OpenJDK 17, systemd service management, and AppArmor security, making it an ideal platform for production-grade Neo4j deployments.

In this guide, we will walk step by step through the process of installing Neo4j Enterprise 5.x on Debian 12.

Prerequisites

Before you begin, make sure you have:

  • A server or VPS running Debian 12 (64-bit)
  • Root or sudo user privileges
  • SSH access to your server
  • Minimum recommended resources: 2 CPU cores, 4 GB RAM, 20 GB SSD

Step 1: Connect to Your Debian Server

On Linux/macOS:

ssh root@your-server-ip

This command opens an SSH session into your server as the root user.

On Windows: use PuTTY, enter root@your-server-ip in the connection field.


Step 2: Install Java and Neo4j

2.1 Update the package list

apt update

Refreshes the package index to ensure you are installing the latest available versions.

2.2 Install OpenJDK 17

apt install openjdk-17-jdk -y

Neo4j 5.x requires Java 17. The -y flag auto-confirms installation prompts.

2.3 Install GnuPG

apt install gnupg -y

Installs GnuPG, required for handling GPG keys to verify package authenticity.

2.4 Add the Neo4j GPG key

wget -O - https://debian.neo4j.com/neotechnology.gpg.key | gpg --dearmor -o /usr/share/keyrings/neo4j.gpg

Downloads the Neo4j GPG key and saves it to /usr/share/keyrings/neo4j.gpg. This ensures apt trusts the Neo4j packages.

2.5 Add the Neo4j repository

echo "deb [signed-by=/usr/share/keyrings/neo4j.gpg] https://debian.neo4j.com stable 5" > /etc/apt/sources.list.d/neo4j.list

Adds the official Neo4j repository to Debian’s package sources.

2.6 Update repositories again

apt update

Refreshes the package index, including the newly added Neo4j repository.

2.7 Install Neo4j

apt install neo4j -y

Installs Neo4j from the official repository.


Step 3: Configure Neo4j

Open the configuration file:

nano /etc/neo4j/neo4j.conf

Modify the following lines, replacing your-ip with your server’s public IP:

server.default_advertised_address=your-ip

# Bolt connector
server.bolt.enabled=true
#server.bolt.tls_level=DISABLED
server.bolt.listen_address=0.0.0.0:7687
server.bolt.advertised_address=your-ip:7687

# HTTP Connector
server.http.enabled=true
server.http.listen_address=0.0.0.0:7474
server.http.advertised_address=your-ip:7474

# HTTPS Connector (disabled by default)
server.https.enabled=false
server.https.listen_address=0.0.0.0:7473
server.https.advertised_address=your-ip:7473

Explanation:

  • Bolt (7687): high-performance protocol used by applications to connect to Neo4j

  • HTTP (7474): web interface access

  • HTTPS (7473): disabled by default; enable when TLS is required in production

Save (CTRL+O) and exit (CTRL+X).


Step 4: Enable and Start the Neo4j Service

systemctl enable neo4j
systemctl start neo4j
  • systemctl enable: configures Neo4j to start automatically on system boot

  • systemctl start: launches the Neo4j service immediately


Step 5: Verify Neo4j Is Running

Check the service status:

systemctl status neo4j

If Neo4j is running, you should see “active (running)”.

Check if the HTTP port is listening:

ss -tulnp | grep 7474

If port 7474 is open, the Neo4j web interface is available.


Step 6: Access the Neo4j Web Interface

Open a browser and go to:

http://your-server-ip:7474

Log in with the default credentials:

  • Username: neo4j

  • Password: neo4j

On first login, Neo4j will prompt you to set a new password for security.


Conclusion

You have successfully installed Neo4j Enterprise 5.x on Debian 12 (Bookworm).

By combining Neo4j with Debian 12, you gain:

  • A stable and secure LTS platform

  • Full compatibility with Java 17 and Neo4j 5.x

  • Convenient systemd-based service management

  • High performance for graph workloads

Your Neo4j instance is now ready for real-world applications such as fraud detection, recommendation systems, IAM, and knowledge graph projects.

Share this Doc

How to Install Neo4j on Debian 12

Or copy link

CONTENTS