This guide will show you how to set up a Neo4j graph database server on a VPS running CentOS 7. Start by logging in to your VPS via SSH as root, then run the commands in the Neo4j yum repo set-up guide documentation. Here’s the gist of that:
Set up Repository
rpm --import https://debian.neo4j.org/neotechnology.gpg.key cat <<EOF> /etc/yum.repos.d/neo4j.repo [neo4j] name=Neo4j RPM Repository baseurl=https://yum.neo4j.org/stable enabled=1 gpgcheck=1 EOF
yum install neo4j-3.5.1
Change Default Password
For security reasons, it’s always best to change the defaults. The default username and password is ‘neo4j’. The following will change the password to whatever you specify by replacing NEW_PASSWORD with your actual new password value.
neo4j-admin set-initial-password NEW_PASSWORD
If you need to access the database remotely, such as with the Neo4j Desktop software, you will need to configure it to listen on the server’s public interface, not just localhost, by editing the configuration file for the server. Edit /etc/neo4j/neo4j.conf and look for this line:
Then change it to:
Without the 0.0.0.0 it will listen only on the localhost address, making it only accessible to users and web apps running on the same server. Changing it to 0.0.0.0 tells the server daemon to listen on *all* interfaces on the server, including the public IP address.
You should now be able to connect to the neo4j server using your neo4j Desktop software.
If you’re attempting to access the neo4j server using a web application on another web server, make sure that your web server allows port 7687 outbound — this port may very well be blocked by a local firewall on the web server.