Goals This guide explains how to deploy a single instance of Neo4j Enterprise on Google Cloud Platform. Prerequisites You should know how to run and operate Neo4j locally. Knowledge of remote drivers to access Neo4j from your application helps you… Read more →
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!
Create Firewall Rules
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.
Create a Google Compute Instance from the Neo4j Public Image
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-3-4 corresponds to an Ubuntu-based image that contains
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:
Access Your New Instance
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.
How do I SSH into the instance?
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:
Configuring your instance
Google VMs can be configured via custom metadata key/values placed on the image. The normal
neo4j.conf file is used to configure the neo4j service inside of the VM, but when running on
google this is driven by a template file you’ll find at
That template contains certain variables, for example:
This means that you can set a custom metadata item on the instance with the key
and its value will be substituted into
neo4j.conf when the service starts. Being able to set
configuration items from outside of neo4j.conf is very convenient when you start integrating
neo4j together with other components.
Within the google image, do not directly edit
it will be replaced by template substitutions each time the service starts. Instead, edit the
template to suit your needs.
If you customize metadata on the VM to configure neo4j, please remember you’ll need to restart the neo4j system service, or restart the VM for those changes to take effect.
Deleting the instance
Once we’ve finished using the instance we can run the following command to delete it: