How to Install Neo4j on Debian 12
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:
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
Refreshes the package index to ensure you are installing the latest available versions.
2.2 Install OpenJDK 17
Neo4j 5.x requires Java 17. The -y
flag auto-confirms installation prompts.
2.3 Install GnuPG
Installs GnuPG, required for handling GPG keys to verify package authenticity.
2.4 Add the Neo4j GPG key
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
Adds the official Neo4j repository to Debian’s package sources.
2.6 Update repositories again
Refreshes the package index, including the newly added Neo4j repository.
2.7 Install Neo4j
Installs Neo4j from the official repository.
Step 3: Configure Neo4j
Open the configuration file:
Modify the following lines, replacing your-ip
with your server’s public IP:
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
: 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:
If Neo4j is running, you should see “active (running)”.
Check if the HTTP port is listening:
If port 7474 is open, the Neo4j web interface is available.
Step 6: Access the Neo4j Web Interface
Open a browser and go to:
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.