Neo4j Installation
I started programming about two years ago. I quickly progressed through numerous Python books, videos, and tutorials in my first year. I think it may be a natural progression, but I suddenly needed a place to store data. You know, a database.
I don’t know why, but I felt reluctant to learn SQL for some reason. To this day (1 year later) I don’t know why I chose this path. Friends and colleagues have told me I chose the harder path, but at the end of the day I think my brain works more like a graph database. It almost seems like I had a Red Pill vs Blue Pill situation, and people are telling me I chose the wrong pill. I’m pretty happy with my selection…
To spread the knowledge, I’ll give you a quick install guide for Neo4j. This is a primer piece for my upcoming article that will cover building a Flask App with Neo4j as the DB. The article will specifically cover user authentication and session management. A topic that I found very little guidance for. Tutorials, videos, and blogs seemed to be out of date or overly complex.
Installation
Running your database locally may be an appealing option. I travel at times and want to do some work while I am on the road. So, running Neo4j on my MacBook is a must. Here is the install which is super simple. Not really worthy of a tutorial.
Download the desktop application and install. link
When I am at home I work with several Neo4j DB instances. So, I run a hypervisor with several Ubuntu VM’s that run Neo4j.
Here is Neo4j install on Ubuntu
Prerequisites
- Ubuntu 18.04
- Access to Ubuntu Terminal or Shell Console (SSH)
Install Steps
- On Ubuntu server run
Sudo apt update
2. Install Java and verify install
Sudo apt install openjdk-8-jdk
Java --version
3. Update the package repository to add Neo4J.
sudo wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -sudo echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee -a /etc/apt/sources.list.d/neo4j.listsudo apt-get update
4. Install Neo4J and verify install
sudo apt install neo4j
Neo4j --version
Configuration for accessing the database
- Edit the Neo4J config file
sudo nano /etc/neo4j/neo4j.conf
2. Locate the following line and un-comment the line to allow connections from any IP address. If you only have a specific IP that you want to allow, enter that IP address only.
dbms.connectors.default_listen_addres-0.0.0.0
Neo4j Service
- Start|Stop|Restart Neo4J
Systemctl {start|stop|restart} neo4j
2. Check status of the service
Service neo4j status
Connecting to Neo4J
1. Web Browser [IPAddress]:7474
2. Enter credentials. Default is neo4j neo4j
3. Change password on the first logon
Note: You may need to restart the service before you are able to connect for the first time.
Pretty simple right? That’s all for now. Catch a more in depth tutorial in my next article.