How to Install Neo4j Graph Database: A Step-by-Step Guide
How to Install Neo4j Graph Database: A Step-by-Step Guide
Neo4j is a powerful and popular graph database known for its ability to store and query highly connected data efficiently. It is widely used in applications such as social networks, recommendation systems, fraud detection, and knowledge graphs. In this tutorial, you will learn how to install Neo4j on your computer, whether you use Windows, macOS, or Linux.
Prerequisites
- You need a supported operating system: Windows 10/11, macOS, or a common Linux distribution.
- Administrative or sudo privileges for installation.
- Latest Java Runtime Environment (JRE) is bundled with Neo4j Desktop, so no separate install is needed for that.
- A stable internet connection to download the installer or Neo4j packages.
1. Choose the Neo4j Installation Method
Neo4j provides several installation options depending on your needs:
- Neo4j Desktop: A user-friendly GUI that lets you run multiple Neo4j instances locally, ideal for development and learning.
- Community Edition: A free, open-source version that can be installed via native installers or package managers.
- Enterprise Edition: Paid, with additional features suited for production environments.
For most users, Neo4j Desktop or the Community Edition is sufficient.
2. Installing Neo4j Desktop
This method is best for beginners and developers trying out Neo4j locally with a GUI interface.
Step-by-step for Windows and macOS:
- Visit the Neo4j Download page (Official site).
- Select Neo4j Desktop and download the installer for your operating system.
- Run the downloaded installer file.
- Follow the installation wizard instructions to complete the setup.
- Launch Neo4j Desktop once installed.
- Create your first graph project and database instance through the GUI.
Step-by-step for Linux (Desktop):
- Neo4j Desktop is mainly supported on Windows and macOS. Linux users commonly use the Community or Enterprise server installations. For a GUI experience on Linux, consider installing Neo4j Browser via the server.
3. Installing Neo4j Community Edition on Linux
This method installs Neo4j as a service, suitable for development and production use.
Step-by-step for Ubuntu/Debian:
sudo apt update
wget -O - https://debian.neo4j.com/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.com stable latest' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt update
sudo apt install neo4j
sudo systemctl enable neo4j.service
sudo systemctl start neo4j.service
After installation, access Neo4j Browser by opening a web browser and navigating to http://localhost:7474. The default username is neo4j and you will be prompted to set a new password on first login.
Step-by-step for CentOS/RHEL:
sudo rpm --import https://debian.neo4j.com/neotechnology.gpg.key
echo '[neo4j]
name=Neo4j Yum Repo
baseurl=https://yum.neo4j.com/stable
enabled=1
gpgcheck=1
gpgkey=https://debian.neo4j.com/neotechnology.gpg.key
' | sudo tee /etc/yum.repos.d/neo4j.repo
sudo yum install neo4j
sudo systemctl enable neo4j.service
sudo systemctl start neo4j.service
4. Verification and Basic Configuration
- Check if Neo4j service is running:
sudo systemctl status neo4j - Open browser at
http://localhost:7474and log in. - Set your new password for the
neo4juser. - Try running a simple Cypher query:
MATCH (n) RETURN n LIMIT 5;
Troubleshooting Tips
- Neo4j won’t start: Check the logs located at
/var/log/neo4j/neo4j.logor Neo4j Desktop logs for specific errors. - Port conflicts: Neo4j uses port 7474 by default. Make sure no other service is using this port.
- Firewall issues: If accessing remotely, ensure port 7474 and 7687 (Bolt) are open.
- Java runtime errors: Neo4j Desktop bundles Java. For server installs, ensure Java 11 or later is installed.
Summary Checklist
- Choose installation method based on your platform and use case.
- Download and run Neo4j Desktop installer or use package managers for server installs.
- Start Neo4j service and verify with browser access to the Neo4j Browser UI.
- Secure your database by changing default passwords.
- Test with sample Cypher queries.
- Troubleshoot using logs and check for common issues.
For more database installation tutorials, consider reading our guide on <a href="/
