Using Neo4j Browser to access Neo4j deployed on AWS EC2

If I deploy Neo4j on AWS EC2, Is it possible to use Neo4j Browser to access neo4j and run Cypher queries? I ask because my code to create nodes and relationships and query them is all in Cypher. I have been using my own laptop so far, but the next dataset is huge, and might require more RAM/storage, so I need to use EC2 for this.

If it is possible, would appreciate if anyone has any links/resources that help with deploying neo4j on ec2 and access it using Neo4J Browser.

Many Thanks.

Definitely possible. I run my Neo4j on EC2 all the time. Change the config file to be accessible to non-local, i.e. - (you should see the line for it ). Change EC2 to have elastic IP and be publicly accessible. If you are behind a firewall make sure you can ssh into the EC2, should allow you to hit it from http://<my.elastic.ip.address>:7474/browser. you can either set up a neo4j service as seen by Debian - Operations Manual or just create a tmux session and run $NEO4J_HOME$/bin neo4j console.

You can also leave it local and if you can ssh into the instance then just run $NEO4J_HOME$/bin cypher-shell, although I normally change the default password via the browser. BTW, EBS-optimized instances suck for normal writing and reading, even on large machines with big IOPS. Best to use the instance storage SSD even though they are ephemeral and then back up the tar gz the graph.db and save to an EBS if you need to snapshot your data.

1 Like

Absolutely. The docs have great installation instructions for Linux. After you install it, make sure you have these lines set in your /etc/neo4j/neo4j.conf:

dbms.connectors.default_listen_address= # Listen for remote connections

I would recommend setting dbms.connector.http.enabled=false so you're not sending credentials and data over the wire in plaintext — use https on port 7473 instead. You don't need to worry about the certificate warnings, your connection is encrypted even with a self-signed cert (created by default, so you don't even need to do that yourself).

Hi Benjamin,

I encountered a similar situation and I came across your answer. I think your answer should be the solution but I got stuck somewhere. I'd really appreciate if you could share your perspectives.

I set up a Neo4j database on AWS EC2 following this tutorial:

I have access to the Neo4j browser version and I can use Cypher in the browser. But I'd like to run Cypher script using a file, instead of manually copy-paste commands into the browser.

What I tried:
By following your answer, I ssh to the instance, but I cannot find the "NEO4J_HOME" folder. All the files I can see is:
"licensing", "", "".

Am I doing something wrong here? Would you please share more insight?
Thanks in advance!

Depending on what distro you have it might be different.

My Home folder is /var/lib/neo4j.

cd /var/lib/neo4j should direct you to the Neo4j Home holder

To run cypher from a shell script/ cypher script, you need to find the bin folder in Neo4j_home and then you can pipe the script into cypher-shell as follows

cat myscript.cypher | bin/cypher-shell -u neo4j -p mypassword

Hi Benjamin,

Thanks for the timely response! I have a follow-up question: I couldn't even find the "/var" folder.

Here's what I did:

  1. Connect to the EC2 instance by:
    "ssh -i Neo4j-AWS-Key.pem"

  2. Execute "ls" and here's what I got:

It looks like completely empty... Nothing there.
However, I can connect to the browser from "http://<my.elastic.ip.address>:7474/browser".

Am I doing something stupid here? Thanks!

According to the link you shared they have the following information: Neo4j Cloud Virtual Machines - Developer Guides

It says it the conf file should be located at /etc/neo4j/neo4j.conf

try cd /var/lib/neo4j
That should change your to the home directory. Other than that I am not sure.

You can navigate your file system/folders with cd

if you run cd .. it will bring to the folder above, if you run cd ../../.. eventually you will get to the root folder. Hope that helps.

Hi Benjamin.

Thanks so much for the help!!! I found the home folder by cd /var/lib/neo4j (previously I thought cannot do this because I didn't see the var folder).
However, there is no bin folder in the directory.

I found the bin folder here: cd /usr/bin, from which I found the cypher-shell.
I don't know why there's no bin folder in the home directory though...

I think I should be able to pipe the script into the shell script then. THANKS SO MUCH for your help!!!