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 Database Neo4j Desktop Intro Neo4j… Read more →
Deploy to Amazon EC2: Host a Single Instance of Neo4j on AWS
This guide explains how to deploy a single instance of Neo4j on Amazon’s EC2 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 have installed the AWS Command Line Interface. If you are not comfortable using the command line, you can install Neo4j using the AWS web console instead.
Let’s get started!
First, we need to create an EC2 key pair that we will use to connect to our instance via SSH.
If you have an existing key that you would like to use instead, you can set
KEY_NAME to the name of that key pair and ignore the 2nd line in the above command that creates one.
Now, we will create a security group, which will allow us to control access to our instance. Run the following command to create a new security group:
Next, let us open Neo4j’s HTTP, HTTPS, and Bolt ports so we can access the server from our application. We will also open the SSH port so we can remotely access the instance. All of these steps are completed in the below command.
If you have an existing group that you would like to use instead, set
GROUP to the name of that group and ignore the rest of the commands.
To start the instance, we’ll need the ID of an Amazon Machine Image (AMI).
Neo4j publishes many different versions, and the AMI ID depends on which region you want to launch in.
AMI IDs are specific to regions, so you need to locate the right ID for your version and region needs.
For that reason, in the instructions below we will provide just a placeholder AMI of
To get the right AMI ID, you can follow these instructions:
Open the AWS EC2 console, and select
AMIson the left-hand nav bar.
In the filter, select
Public imagesand search for either “neo4j-enterprise” or “neo4j-community” depending on which version you would like to use.
You will know you are using the right one when you see the “Owner” field showing this number:
- Locate the version you want, and use the AMI ID in the script below.
As an example: Neo4j Enterprise 3.5.1 is AMI ID
region us-west-2. As new versions are published, they will be mentioned in the Cloud topic on the Neo4j community site.
If you would like to use the CLI to do this same step, the following command locates all image
IDs and names for the images Neo4j publishes in
By changing the region, you can find AMI IDs near you.
We are now ready to start up a Neo4j instance.
Make sure to substitute
ami-XYZ with your chosen AMI ID from the directions above!
We do not yet have a public DNS name but it should be available after a few seconds.
We can run the following command to find out what it is:
Please note that your security group settings may affect whether or not a public DNS name is associated with your instance. If this command does not work for you, check to make sure your security group is properly configured and that it is not associated with a VPC.
Now, let’s navigate to
https://[PublicDnsName]:7473 and login with the user name
neo4j and password
Some methods of launching Neo4j on AWS (such as via the AWS marketplace) automatically set the password of
an instance to the instance ID you launched.
Other methods (such as when launching enteprise AMIs directly) leave the password as the default
You can run the following command to SSH into the instance:
You might get an error about the permissions on the pem file, so don’t forget to make sure it isn’t accessible by any other users. Permissions for the pem can be locked down similar to those shown below (owner = read+write, group = none, users = none).
Please consult Neo4j Cloud VMs for details on internals of virtual machines, including configure Neo4j inside of the VM and access various files.
Once we have finished using the instance, we can run the following command to terminate it:
You can ask questions and connect with other people launching Neo4j in the cloud through the cloud topic on the Community Site.