How To Install Neo4j on AlmaLinux 9
In this tutorial, we will show you how to install Neo4j on AlmaLinux 9. Neo4j is a powerful and scalable graph database management system that utilizes graph structures to store and query data efficiently. Unlike traditional relational databases, Neo4j is designed to handle highly interconnected data, making it an excellent choice for applications that involve complex relationships, such as social networks, recommendation engines, and fraud detection systems.
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 AlmaLinux 9. You can follow the same instructions for CentOS and Rocky Linux or RHEL-based.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 9.
- 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 Neo4j.
- Neo4j requires certain permissions that can only be granted to a superuser or a user with
sudo
privileges. Ensure that you have the necessary administrative access.
Install Neo4j on AlmaLinux 9
Step 1. Before installing Neo4j, ensure your AlmaLinux 9 system is up-to-date. You can use either yum
or dnf
to update your system:
sudo dnf clean all sudo dnf update
Step 2. Installing Java.
Neo4j requires Java 17 or later to run. Since AlmaLinux 9 doesn’t include OpenJDK 17 in its default repositories, we’ll need to install it manually. Run the following command to install OpenJDK 17:
sudo dnf install java-17-openjdk
Verify the Java installation:
java --version
Set the JAVA_HOME
environment variable if required by your applications:
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
Step 3 Installing Neo4j on AlmaLinux 9.
Since the Neo4j packages are not included in the default AlmaLinux repositories, we’ll need to add the official Neo4j repository to our system.
First, import the Neo4j GPG key:
rpm --import https://debian.neo4j.com/neotechnology.gpg.key
Create a new repository file for Neo4j:
sudo nano /etc/yum.repos.d/neo4j.repo
Add the following lines to the file:
[neo4j] name=Neo4j RPM Repository baseurl=https://yum.neo4j.com/stable enabled=1 gpgcheck=1
With the Neo4j repository set up, we can now proceed to install the Neo4j package.
sudo dnf update sudo dnf install neo4j
If you’re installing the Neo4j Enterprise Edition, you’ll be prompted to accept the license agreement during the installation process.
Start and enable the Neo4j service:
sudo systemctl start neo4j sudo systemctl enable neo4j
Step 4. Configure Neo4j.
Neo4j comes with several configuration files that allow you to customize various aspects of the database, such as memory allocation, remote access, and security settings.
The main configuration file for Neo4j is located at /etc/neo4j/neo4j.conf
. You can edit this file using your preferred text editor:
sudo nano /etc/neo4j/neo4j.conf
Some common configuration settings you might want to adjust include:
dbms.memory.heap.initial_size
anddbms.memory.heap.max_size
: These settings control the initial and maximum heap size allocated to Neo4j. Adjust these values based on your system’s available memory.dbms.connectors.default_listen_address
: This setting specifies the IP address and port on which Neo4j will listen for incoming connections. By default, it’s set to0.0.0.0:7687
, which means Neo4j will listen on all available network interfaces.dbms.security.auth_enabled
: This setting enables or disables authentication for Neo4j. It’s recommended to keep it enabled for production environments.
After making any configuration changes, restart the Neo4j service for the changes to take effect:
sudo systemctl restart neo4j
Step 5.Access Neo4j Web Interface.
Neo4j comes with a built-in web interface called the Neo4j Browser, which allows you to interact with your graph database, run Cypher queries, and visualize your data.
To access the Neo4j Browser, open your web browser and navigate to http://localhost:7687
. You’ll be prompted to log in with the default credentials:
Username: neo4j Password: neo4j
Congratulations! You have successfully installed Neo4j. Thanks for using this tutorial for installing the Neo4j graph database management on your AlmaLinux 9 system. For additional help or useful information, we recommend you check the official Neo4j website.