Goals This guide explains how to deploy Neo4j on Amazon’s EC2 platform. Prerequisites 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.… Read more →
This guide explains how to deploy 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.
Let’s get started!
Create EC2 key pair
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’d like to use instead, you can set
KEY_NAME to the name of that key pair and ignore the 2nd command.
Create security group
Now we’ll 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’s 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.
If you have an existing group that you’d like to use instead, set
GROUP to the name of that group and ignore the rest of the commands.
Start up the instance
We are now ready to start up a Neo4j instance.
We will use the
image-id for us-east-1, but there are corresponding image ids for other regions.
We don’t yet have a Public DNS Name but it should be available in 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 is not associated with a VPC.
Now let’s navigate to
https://[PublicDnsName]:7473 and login with the user name
neo4j and password
Note that in some methods of launching neo4j on AWS, such as via the AWS marketplace, the password of an instance will be automatically set to the instance ID you launched. In other cases, such as when launching enteprise AMIs directly, the password is left as the default “neo4j”. In either case, we recommend changing the password immediately after you launch.
How do I SSH into the instance?
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.
How the AWS Virtual Machine Works
Please consult Neo4j Cloud VMs for details on internals of AWS VMs, including how to stop and start system services, configure Neo4j inside of the VM, and more.
How do I find the
image-id for other regions?
If we’re in a different region than us-east-1, we can run the following command to find out the
image-id for that region.
We can then substitute that
image-id when starting up an instance.
This same filter command can be used to locate AMIs for neo4j-community.
Terminating the instance
Once we’ve finished using the instance we can run the following command to terminate it: