General neo4j reference:
https://neo4j.com/docs/developer-manual/3.2/introduction/
-
docker pull neo4j
-
Create folder structure for storing neo4j database content, import data, and logs outside the docker container:
cd $HOME && mkdir neo4j neo4j/data neo4j/import neo4j/logs
-
Launch neo4j
The command below will
- make neo4j accessible via its http (port 7474) and bolt interfaces (port 7687)
- make it store database data and logs in mapped locations outside the container and
- look for import data in an external folder, too
- have it act on behalf of the current user (so that you have regular access rights to the data in the mapped locations)
sudo docker run \ --publish=7474:7474 --publish=7687:7687 \ --volume=$HOME/neo4j/data:/data --volume=$HOME/neo4j/import:/import --volume=$HOME/neo4j/logs:/logs \ --user=`id -u`:`id -g` neo4j
-
Check availability of the database server in your browser at http://127.0.0.1:7474/browser/
Resources:
- https://neo4j.com/docs/operations-manual/current/docker/
- https://neo4j.com/developer/docker-run-neo4j/
- https://neo4j.com/developer/docker/
-
Install java and check version
sudo apt install default-jre
java --version
-
Install Neo4j
wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee -a /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo apt-get install neo4j=1:3.5.12
-
Minimal configuration of neo4j
- Uncomment the line
dbms.connectors.default_listen_address=0.0.0.0
in/etc/neo4j/neo4j.conf
- Uncomment the line
-
Starting/Stopping the Neo4j database service
sudo service neo4j start
sudo service neo4j stop
sudo service neo4j restart
Resources:
- https://neo4j.com/docs/operations-manual/current/installation/linux/debian/#debian-installation
- https://dzone.com/articles/installing-neo4j-on-ubuntu-1604
https://neo4j.com/download/neo4j-desktop/?edition=desktop
python3 -m venv graph_db
. graph_db/bin/activate
pip install py2neo requests
conda create --name graph_db python=3.6
pip install py2neo
conda install requests
-
For a OS package manager installed neo4j:
sudo cp data/* /var/lib/neo4j/import/
-
For neo4j running in docker:
cp data/* $HOME/neo4j/import
-
Visit http://127.0.0.1:7474/browser/ in your browser and log in with the default credentials:
username: neo4j password: neo4j
-
Set a new password upon being prompted to do so
Find the file run_create_db.sh
inside the cloned repo folder, and:
-
Edit it to use
- the password you set for your database account
- the paths to the CSV data files in the neo4j import directory (see above)
-
From inside the cloned repo folder run:
sh run_create_db.sh
Building the database should take < 1 minute with an OS package manager-installed neo4j (expect 1-5 minutes with the less performant docker version).
After that go back to the neo4j web interface and start exploring!