Neo4j on GCPEnterprise Edition
Neo4j can be easily deployed on Virtual Machines in Google Cloud Platform (GCP) by using the official listing on the GCP Marketplace. It can be configured to deploy only Neo4j Enterprise Edition 2025.x, both standalone and cluster (1, 3, 4, 5, 6, or 7 servers). Previous versions of Neo4j, such as 4.4 and 5.26 LTS are no longer supported.
Neo4j Terraform deployment module
The GCP Marketplace listing uses HashiCorp Terraform IaC tool to deploy Neo4j Enterprise Edition on GCP. HashiCorp Terraform is an infrastructure deployment module, which automates the creation and management of Google Cloud resources. It takes several parameters as inputs, deploys a set of cloud resources, and provides outputs that can be used to connect to a Neo4j DBMS.
You can find the repository for the Terraform configuration files on GitHub. The repository structure is as follows:
neo4j-terraform-gcp/
├── modules/ # Terraform modules
│ └── neo4j/ # Main Neo4j module
│ ├── scripts/ # Startup scripts for Neo4j
│ ├── main.tf # Main module configuration
│ ├── network.tf # Network configuration
│ ├── variables.tf # Module variables
│ ├── outputs.tf # Module outputs
│ └── versions.tf # Module provider requirements
├── test/ # Test configurations
├── metadata.yaml # GCP Marketplace metadata
├── metadata.display.yaml # GCP Marketplace display metadata
├── logo.png # Logo for GCP Marketplace
├── main.tf # Root module configuration
├── variables.tf # Root module variables
├── outputs.tf # Root module outputs
├── versions.tf # Provider and version constraints
└── terraform.tfvars.example # Example variables file
Important considerations
-
The deployment of cloud resources incurs costs. Refer to the GCP pricing calculatorfor more information.
-
The Neo4j Terraform module deploys a new VPC, containing a single subnet based in the requested region. Unlike Azure and AWS where subnets are aligned to specific zones, GCP subnets are regional (and VPCs are global).
-
The Neo4j Terraform module uses an Instance Group to deploy VM instances. To stop a VM managed by a group, you must first remove it from that group.
-
Instances can be connected via SSH, using SSH-in-browser (via the GCP console). Click the SSH button in the GCP console.
Deployment steps
Before deploying Neo4j using the Terraform module, ensure you have the following prerequisites in place:
-
Terraform 1.2.0 or newer. See the official Terraform installation guide for instructions.
-
Google Cloud SDK
-
A GCP project with billing enabled
-
Appropriate permissions to create resources in GCP
-
Default project configured in
gcloudCLI (gcloud config set project YOUR_PROJECT_ID)
Option 1: Deploy from GCP Marketplace
-
Visit the Neo4j Enterprise listing on GCP Marketplace.
-
Click Launch.
-
Configure the deployment parameters. See Input parameters for details on each parameter.
-
Review and click Launch.
Option 2: Use the module directly
-
Ensure your default GCP project is set in gcloud CLI:
gcloud config set project YOUR_PROJECT_ID -
Copy
terraform.tfvars.exampletoterraform.tfvarsand update the values. See Input parameters for details on each parameter. -
Initialize Terraform in the directory containing the Terraform configuration files:
terraform init -
Plan the deployment:
terraform plan -
Apply the configuration:
terraform apply
Input parameters
The following variables can be configured in your terraform.tfvars file.
The complete list of inputs can be found in the ./variables.tf file.
|
| Variable | Parameter Name | Description | Default Value |
|---|---|---|---|
|
Project ID |
GCP Project ID of the project in which to provision resources. |
|
|
License type |
Neo4j license type (enterprise-byol or evaluation). |
|
|
Region |
The GCP region where resources will be created. |
|
|
Zone |
The zone for the solution to be deployed. |
|
|
Deployment Name |
The name of the deployment and VM instances. |
|
|
Image version |
The VM image to use for Neo4j instances. |
|
|
Network name |
The name of the VPC network to use or create. |
|
|
Subnetwork name |
The name of the subnetwork to use or create. |
|
|
Create a new network |
Whether to create a new network or use an existing one |
|
|
Subnetwork CIDR |
CIDR range for the subnetwork. |
|
|
Number of servers |
Number of Neo4j servers to deploy. Node count must be 1 (standalone) or 3/5/7 (cluster) |
|
|
Machine type |
GCP machine type for the Neo4j servers. |
|
|
Disk size in GB |
Size of the data disk in GB. |
|
|
Admin password |
Password for the Neo4j admin user. The password must be at least 8 characters long. |
|
|
Install Neo4j Bloom |
Whether to install Neo4j Bloom. |
|
|
Bloom License Key |
License key for Neo4j Bloom (if installing). |
|
|
Firewall source ranges |
Source IP ranges for external access (comma-separated). Traffic is only allowed from sources within these IP address ranges. Use CIDR notation when entering ranges. |
|
Deployed cloud resources
The environment created by the Terraform module consists of the following GCP resources:
-
A VPC network and subnetwork (optional).
-
Firewall rules for internal and external access.
-
Neo4j VMs with attached persistent disks.
-
Configures Neo4j for standalone or clustered operation.
Template outputs
After the installation finishes successfully, the Terraform module provides the following outputs:
| Output Name | Description |
|---|---|
neo4j_url |
URL to access Neo4j Browser. |
neo4j_bolt_url |
Bolt URL to connect to Neo4j. |
neo4j_ip_addresses |
IP addresses of the Neo4j nodes. |
neo4j_instance_names |
Names of the Neo4j instances. |
neo4j_instance_zones |
Zones where Neo4j instances are deployed. |
neo4j_instance_machine_types |
Machine types of Neo4j instances. |
|
The Neo4j Browser can be easily launched in a new window by clicking the button entitled Log into the Neo4j Browser. |
Providers used
This module only uses the following approved GCP Marketplace providers:
-
google
-
google-beta
Testing the module
The module includes test configurations in the test/ directory, which can be used to validate the deployment. The following test scripts are provided:
-
verify_module.sh: Basic verification for GCP Marketplace -
test_deployment.sh: Comprehensive deployment testing using marketplace_test.tfvars
The test script performs thorough checks to verify:
-
All instances are properly deployed.
-
Neo4j services are running and accessible.
-
Neo4j Browser and Bolt interfaces are operational.
-
Cluster configuration is properly set up.
Licensing
Installing and starting Neo4j from the GCP marketplace constitutes an acceptance of the Neo4j license agreement. When deploying Neo4j, you are required to confirm that you either have an Enterprise license or accept the terms of the Neo4j evaluation license.
If you require the Enterprise version of Bloom, you need to provide a key issued by Neo4j as this is required during the installation.
To obtain a valid license for Bloom reach out to your Neo4j account representative or get in touch using the contact form.
Delete deployment and destroy resources
To delete the deployment and destroy all associated resources, you can use the following Terraform command:
terraform destroy
This command will prompt you to confirm the destruction of all resources defined in your Terraform configuration.
Review the proposed changes carefully before confirming.
For detailed information on the terraform destroy command, refer to the official Terraform documentation.