top of page
DBAGenesis_png.png

Install Neo4j on Docker

On Windows platform:


Install Docker by going to the website https://docs.docker.com/desktop/windows/install/ and downloading the docker file.


Note: A 64-bit processor and 4GB system RAM are the hardware prerequisites required to successfully run Docker on Windows 10.


Double-click on the Docker Desktop Installer.exe to run the installer.




Once you start the installation process, always enable Hyper-V Windows Feature on the Configuration page and follow the installation process to allow the installer and wait till the process is done.



After completion of the installation process, click Close and restart your PC.



Sign In the Docker https://hub.docker.com/ search for the NEO4j






Open Command Prompt as Administrative Rights



run the below command to pull the official image of Neo4j


docker pull neo4j

After completion



To verify open the Docker and click the Images menu.





To Run open the command prompt and run the following command.


docker run -it --rm --publish=7474:7474 --publish=7687:7687 -e NEO4J_dbms_connector_https_advertised__address=":7473" -e NEO4J_dbms_connector_http_advertised__address=":7474" -e NEO4J_dbms_connector_bolt_advertised__address=":7687" --env=NEO4J_AUTH=none   neo4j 


open the link http://localhost:7474/ in the browser and set name and password.




Now you are connected to database:




open terminal and test cypher command


neo4j@neo4j> match (n) return count(n);



On Linux platform:


Installing Docker on Oracle Linux 8/7


Before we begin, run the system update command to rebuild the repo cache and update installed packages.


sudo yum update

Now Install some of the default packages


sudo yum install -y yum-utils

Add Docker repository to Oracle Linux


sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo 

Add this below entry to the /etc/yum.repos.d/docker-ce.repo file


[centos-extras]
name=Centos extras - $basearch
baseurl=http://mirror.centos.org/centos/7/extras/x86_64
enabled=1
gpgcheck=1
gpgkey=http://centos.org/keys/RPM-GPG-KEY-CentOS-7

Now run the below command to install the extra plugin required by the docker


yum -y install slirp4netns fuse-overlayfs container-selinux


Lastly, to install Docker Engine, command line and contained (a standalone high-level container runtime) run, finally, this command.


sudo yum install docker-ce docker-ce-cli containerd.io


Enable and start the Docker service


sudo systemctl start docker
sudo systemctl enable docker


Add User to Docker group


By default, docker needs the root access to run commands, Therefore, we will add our current or the user that you want to use to access docker to the docker group.


sudo groupadd docker
sudo usermod -aG docker your_user

Now, we have finally Installed Docker in Oracle Linux. Our Next step is to PULL the Neo4j Image.


docker pull neo4j

After, Image is downloaded in the docker, we are ready to run it.



To verify it, we can use web browser to and open url


localhost:7474





Cypher Shell


If you want to run cypher shell, Run the below command


docker exec -it testneo4j bash

cypher-shell -u neo4j -p test

Thank you.

Become a top notch dba with DBA Genesis
Become a DBA with DBA Genesis.png
bottom of page