Categories: TutorialsUbuntu

How to Install and Configure Neo4j on Ubuntu 20.04

Written in Java, Neo4j is an open-source, graph database management system. Unlike the traditional relational databases such as SQL which have tables with rows and columns, a graph database is characterized by nodes, edges, and properties. Graph databases usually offer better performance than their SQL and NoSQL counterparts.

In a graph database, data is modeled as nodes and relationships between those data nodes. Neo4j can query complex relationships with low overhead since all the nodes have references to other nodes that are related. Neo4j is available in a community edition that is free and an enterprise edition for commercial purposes.

Sponsored

This guide will take you through the installation of Neo4j on Ubuntu 20.04

Step 1: Update your system

We recommend updating that package index of your system before proceeding. Further.So, launch your terminal and run the following command:

$ sudo apt update

Once updated, proceed and carry on the subsequent steps.

Step 2: Install Packages

Next, we will install a few additional packages. These packages may already be present in your Ubuntu 20.04 system, but you can still run the command given below:

$ sudo apt install software-properties-common apt-transport-https ca-certificates 

Step 3: Download and Add GPG Key

The Neo4j database engine isn’t included in the official Ubuntu package repository. We need to add the GPG key from Neo that will allow us to install Neo4j on Ubuntu 20.04

So, proceed and download and add the Neo4j GPG key.

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

Thereafter, add the Neo4j 4.3 repository to the sources list file.

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

Next, refresh the package lists.

$ sudo apt update

In subsequent steps, we will focus on installing and managing the Neo4j database management service.

Step 4: Install Neo4j

In this step, we will install Neo4j. This will also download a few other dependencies needed by neo4j. Additionally, a compatible Java version will be installed on your system. Run the command:

$ sudo apt install neo4j

Once the installation is done, enable and start the Neo4j service by running the following command:

$ sudo systemctl enable neo4j.service
$ sudo systemctl start neo4j.service

Verify neo4j is installed and running successfully as shown:

$ sudo systemctl status neo4j.service

You will get the output below:

Step 5: Configure Neo4j

Now that Neo4j is up and running, we can connect to the database and set up administrator credentials. To achieve this, we will leverage the cypher-shell which is a command-line utility for running queries against the Neo4j database instance.

Sponsored

So, fire up the interactive shell with the command:

$ cypher-shell

Once you start the shell, log in with the default credentials:

username: neo4j

Password: neo4j

For obvious security reasons, you will be required to set a new strong password. So go along and provide a robust password.

Step 6: Connecting to the web interface

In this step, we will access the Neo4j web dashboard. So, launch your favorite web browser and visit the URL shown to access Neo4J login page.

localhost:7687/

By default, Neo4j is configured to accept only connections from localhost IP addresses. The reason behind this is to provide some added security for the database engine

To access Neo4j from an external system, edit the /etc/neo4j/neo4j.conf file, locate and uncomment the following line:

dbms.default_listen_address=0.0.0.0 

You can also specify your server’s IP address in the configuration file.

Now, to access Neo4j dashboard, use your the administrator login details. You will see the Neo4j web interface shown below:

That’s it with installing Neo4j on Ubuntu 20.04. We trust the guide was an eye-opener to getting started with neo4j on Ubuntu 20.04.

Ubuntu Server Admin

Recent Posts

Kolla Ansible OpenStack Installation (Ubuntu 24.04)

Kolla Ansible provides production-ready containers (here, Docker) and deployment tools for operating OpenStack clouds. This…

14 hours ago

Canonical announces first Ubuntu Desktop image for Qualcomm Dragonwing™ Platform with Ubuntu 24.04

This public beta enables the full Ubuntu Desktop experience on the Qualcomm Dragonwing™ QCS6490 and…

2 days ago

The long march towards delivering CRA compliance

Time is running out to be in full compliance with the EU Cyber Resilience Act,…

2 days ago

Extra Factor Authentication: how to create zero trust IAM with third-party IdPs

Identity management is vitally important in cybersecurity. Every time someone tries to access your networks,…

3 days ago

Ubuntu Weekly Newsletter Issue 889

Welcome to the Ubuntu Weekly Newsletter, Issue 889 for the week of April 20 –…

4 days ago

From pidfd to Shimanami Kaido: My RubyKaigi 2025 Experience

Introduction I just returned from RubyKaigi 2025, which ran from April 16th to 18th at…

5 days ago