DebianDebian Based

How To Install Neo4j on Debian 12

Install Neo4j on Debian 12

In this tutorial, we will show you how to install Neo4j on Debian 12. Neo4j is a powerful, open-source graph database that has gained significant popularity in recent years due to its ability to efficiently store, manage, and query highly connected data. With its flexible data model and Cypher query language, Neo4j enables developers to build intelligent applications that leverage complex relationships between data entities. This makes it an ideal choice for various use cases, such as recommendation engines, fraud detection, knowledge graphs, and social networks.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Neo4j graph database management on a Debian 12 (Bookworm).

Prerequisites

Before proceeding with the installation of Neo4j on Debian 12, ensure you meet the following requirements:

  • A server running one of the following operating systems: Debian 12 (Bookworm).
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • An active internet connection. You’ll need an internet connection to download the necessary packages and dependencies for the Neo4j.
  • A user account with sudo privileges to execute administrative commands.

Install Neo4j on Debian 12 Bookworm

Step 1. To check if your Debian 12 system is up to date, open a terminal and run the following commands:

sudo apt update
sudo apt upgrade

These commands will update the package list and upgrade any outdated packages to their latest versions, ensuring that your system is ready for the Neo4j installation.

Step 2. Installing Java.

Another crucial prerequisite is having Java runtime environment installed. Neo4j relies on Java to run its server and client applications. To check if Java is already installed on your Debian system, open a terminal and run the following command:

java -version

If Java is not installed, you can easily install it using the apt package manager. Update your package list and install the default JDK with these commands:

sudo apt update
sudo apt install default-jdk

Step 3. Installing Neo4j on Debian 12.

Debian’s apt package manager simplifies the installation and management of software packages. To ensure that you have access to the latest stable version of Neo4j, it’s recommended to add Neo4j’s official Debian repository to your system. This repository is maintained by the Neo4j team and provides a convenient way to install and update Neo4j.

First, download and add the GPG key used to sign the Neo4j packages:

wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -

Add the Neo4j repository URL to your system’s sources list:

echo 'deb https://debian.neo4j.com stable latest' | sudo tee -a /etc/apt/sources.list.d/neo4j.list

Neo4j offers two editions: Community and Enterprise. The Community edition is open-source and provides a robust set of features suitable for most use cases. If you’re just getting started with Neo4j or have a small-scale project, the Community edition is an excellent choice.

To install Neo4j Community edition using apt, run the following command:

sudo apt install neo4j

This command will fetch the latest stable version of Neo4j Community from the repository and install it on your Debian system. If you want to install a specific version, you can append the version number to the package name, like this:

sudo apt install neo4j=1:4.4.11

During the installation process, you’ll see the progress of package retrieval, unpacking, and setup. Once the installation is complete, you can verify the successful installation by running:

neo4j --version

Step 4. Configuring Neo4j.

Neo4j provides a flexible configuration system that allows you to customize various aspects of your Neo4j installation. The main configuration file is located at /etc/neo4j/neo4j.conf. This file contains settings for networking, security, performance tuning, and more.

To edit the configuration file, open it with your preferred text editor using sudo:

sudo nano /etc/neo4j/neo4j.conf

Some important configuration options to consider are:

  • dbms.default_listen_address: Specifies the IP address or hostname that Neo4j should bind to. By default, it listens on localhost (127.0.0.1).
  • dbms.connector.bolt.enabled: Enables or disables the Bolt protocol, which is used for client connections. Set it to true to enable Bolt.
  • dbms.connector.http.enabled: Enables or disables the HTTP connector for the Neo4j browser and REST API. Set it to true to enable HTTP access.
  • dbms.memory.heap.initial_size and dbms.memory.heap.max_size: Configures the initial and maximum heap size for the Neo4j server JVM.

After making any changes to the configuration file, save it and restart the Neo4j service for the changes to take effect:

sudo systemctl restart neo4j

With Neo4j installed and configured, you can now start the Neo4j service and access the database using the web interface or client libraries.

To start the Neo4j service, run:

sudo systemctl start neo4j

Step 5. Accessing Neo4j Web UI.

Once the service is running, you can access the Neo4j web interface by opening a web browser and navigating to http://localhost:7474. You’ll be prompted to log in with the default credentials (username: neo4j, password: neo4j). After logging in, you’ll be asked to set a new password for the “neo4j” user.

Congratulations! You have successfully installed Neo4j. Thanks for using this tutorial to install the latest version of the Neo4j graph database management on Debian 12 Bookworm. For additional help or useful information, we recommend you check the official Neo4j website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button