Developer Guides Getting Started Getting Started What is a Graph Database? Intro to Graph DBs Video Series Concepts: RDBMS to Graph Concepts: NoSQL to Graph Getting Started Resources Neo4j Graph Platform Graph Platform Overview Neo4j Desktop Intro Neo4j Browser Intro… Read more →
Hosting Neo4j on Google Compute Engine
This guide explains how to deploy a single instance of Neo4j Enterprise on Google Cloud Platform.
You should know how to run and operate Neo4j locally. Knowledge of remote drivers to access Neo4j from your application helps you connect to your cloud-hosted database.
Before continuing with the guide make sure you’ve installed the GCloud Command Line Interface.
Let’s get started!
By default, Google won’t let traffic in and out of instances unless we allow it. So we begin by setting a simple firewall rule which will enable us to access the instance once it is launched:
This allows traffic into your node on port 7473 (HTTPS for Neo4j Browser) and 7687, which is
the Bolt protocol for clients to work with the database. The source IP range provided allows
the entire internet to contact your new instance, which you may narrow. The target tags
specifies that this rule applies only to instances tagged
neo4j. When we launch our
instance, we’ll take care to apply that tag to it. In Google’s Cloud Console, here’s what
your rule should look like:
We don’t have to open port 22 for SSH, that will already be done.
Launching the instance is a single command:
The first line simply sets your project configuration to ensure you know where you are launching
your instance. The second line launches an image found in a public project that we have provided.
The image name
neo4j-enterprise-1-3-4-9-apoc corresponds to an Ubuntu-based image that contains
Neo4j 1:3.3.9, with the APOC plugin.
If you get an “image not found” error, this may mean you are attempting to launch a version that Neo4j has not published.
Note that the
gcloud tool comes with many command line options that aren’t covered here.
consult the documentation
for a large number of options dealing with machine type, memory, available storage, and so on.
--tags argument is important, because it allows us to configure the correct network
permissions in the next step. By default, Google will block all external access to the network
services unless you open them.
You’ll know that the launch succeeded when you see output like this:
https://[External_IP]:7473 and login with the user name
neo4j and password
You will be prompted to change the password immediately.
Because you don’t have a hostname configured or a valid SSL certificate by default, your browser will warn you that the certificate isn’t trusted. This is expected, you can configure a certificate later if you choose.
You can run the following command to SSH into the instance:
Inside of the VM, you can check the status of the neo4j service like this:
Please consult Neo4j Cloud VMs for details on internals of Google VMs, including how to stop and start system services, configure Neo4j inside of the VM, and more.
Once we’ve finished using the instance we can run the following command to delete it:
You can ask questions and connect with other people launching Neo4j in the cloud at the cloud topic on the Community Site.