Image: peopleimages.com/Adobe Stock
If your project uses a graph database and you’ve opted to go with the open-source Neo4j, you’ll be happy to know there’s a desktop app available that makes connecting to remote servers and managing databases very easy.
The app in question is called the Neo4j Desktop and is freely available and installable on Linux, macOS and Windows. The only caveat to the Linux installation is that it’s available as an AppImage.
SEE: 40+ open source and Linux terms you need to know (TechRepublic Premium)
The Neo4j Desktop app is designed to help new users learn the ins and outs of the Neo4j database. This app can create and connect to a local database for experimental purposes or to a remote server for the management of production databases.
In this tutorial, I’m going to show you how to install the Neo4j Desktop app on Pop!_OS Linux. The installation of the app on both macOS and Windows is as straightforward as any app; you just download and run the installer file. For Linux, it’s a bit less obvious.
Jump to:
What you’ll need to install and use the Neo4j Desktop app
To install the Neo4j Desktop app, you’ll need a running instance of any Linux distribution that supports AppImage. To connect the Neo4j Desktop app to a remote server, you’ll need an instance of the Neo4j graph database up and running on a remote server that is accessible from the desktop where you’ll be installing the app.
That’s all you need. Let’s get to work.
How to install the Neo4j Desktop app
To download the Neo4j AppImage, point your browser to the Neo4j Download page, and click Download. You’ll be prompted to fill out a form, and the site will auto-detect your OS, so you don’t have to select which download to save.
Once you’ve filled out the required form, save the AppImage to your local drive. You will also be presented with a Neo4j Desktop Activation Key. Make sure to copy that key and save it.
As to where you should save the downloaded file, I recommend creating a directory to house your AppImages with the command:
mkdir ~/AppImages
Save all of your AppImage files in that directory, so you always know where they are.
Once the download completes, give the file executable permission with this command:
chmod u+x ~/AppImages/neo4j-desktop*.AppImage
If you saved the download file to another directory, make sure to alter the above command to reflect that.
You can now start the desktop app with the command:
~/AppImages/neo4j-desktop*.AppImage
When you first run the app, you will be asked if you want to Run or Run And Integrate. Make sure to select Run And Integrate, so an entry for Neo4j Desktop will be added to your desktop menu. This way, you don’t have to run the app from the command line.
How to use the Neo4j Desktop app
To start using Neo4j Desktop, open the Neo4j application. You’ll be prompted to paste the Software Key from the download page; make sure you do that, or you won’t be able to use the application. When Neo4j opens (Figure A), you’ll be greeted by an example project you can use to test-drive the Neo4j database. If you’ve already deployed Neo4j on a remote server, you can go ahead and connect to it from the app.
Figure A
The Neo4j Desktop app is designed so anyone can get up to speed with it in minutes.
To connect Neo4j Desktop to the remote server, click the Add dropdown, and select Remote Connection (Figure B).
Figure B
Adding a new connection to the Neo4j Desktop app.
In the resulting window (Figure C), give the new connection a name, and then, type the URL for the remote server.
Figure C
Adding a remote connection to the Neo4j Desktop app.
The structure of the Connect URL is similar to what was used when installing Neo4j and testing the connection, so it’ll look something like this:
neo4j://192.168.1.7:7687
192.168.1.7 is the IP address of the server hosting your Neo4j database.
Click Next, and when prompted (Figure D), type the username and password for the Neo4j database. The default username is neo4j, and the password is what you used when you first tested the Neo4j connection while installing Neo4j.
Figure D
Adding user credentials for our remote connection.
Click Save, and you’ll find yourself on the Projects page with your new connection listed (Figure E).
Figure E
Our new remote connection has been successfully saved.
Now, click Open, and a new window will appear displaying the Neo4j console, as seen through the Desktop app GUI (Figure F).
Figure F
You can now start managing your Neo4j database.
How to create your first Neo4j node
At the neo4j$ prompt in the GUI, let’s create a node called EMPLOYEES and add the name Jack Wallen to it. For that, the command would be:
CREATE ( :EMPLOYEES {name: ‘Jack Wallen’});
Click the Run button to the right of the command prompt, and the node will be created. You can then create a second node with this command:
CREATE ( :EMPLOYEES {name: ‘Olivia Nightingale’});
Let’s now create a relationship between the two. Let’s say Jack and Olivia are colleagues, and we want to add that relationship. For that, the command would be:
CREATE (:EMPLOYEES {name: ‘Jack Wallen’})-[:COLLEAGUE]->(:EMPLOYEES {name: ‘Olivia Nightingale’});
Benefits of using the Neo4j Desktop app
You might be asking yourself why you should bother with a GUI when all you’re doing is typing commands. One handy feature of the Node4j Desktop app that makes it worth the effort is it does autocompletion.
SEE: Hiring kit: Database administrator (TechRepublic Premium)
For example, if you type CREATE (, the Neo4j Desktop app will auto-complete the ) to ensure your queries are created correctly. You can also save a query as a favorite, so if you have long queries that you find yourself typing over and over, just click the star in the history (Figure G), and the query will be available to you at any time.
Figure G
Adding a query as a favorite in the Neo4j Desktop app.
Once you start using the Neo4j Desktop app, you’ll soon understand why it’s a helpful addition to your tech stack. The app makes learning and interacting with the Neo4j Graph Database considerably easier than just approaching it from the command line. Give this desktop GUI a try, and see if it doesn’t become your go-to for working with Neo4j databases.
Subscribe to TechRepublic’s How To Make Tech Work on YouTube for all the latest tech advice for business pros from Jack Wallen.