# Connect to a remote server via. SSH - Using elasticsearch package (Node JS)

**URL:** <https://discuss.elastic.co/t/connect-to-a-remote-server-via-ssh-using-elasticsearch-package-node-js/125842>\
**Category:** Elasticsearch\
**Created:** [March 28, 2018, 3:24am UTC](https://discuss.elastic.co/t/connect-to-a-remote-server-via-ssh-using-elasticsearch-package-node-js/125842 "2018-03-28T03:24:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhilash\_Sathe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abhilash_sathe/32/28555_2.png) [@Abhilash\_Sathe](https://discuss.elastic.co/u/Abhilash_Sathe)\
**Post date:** [March 28, 2018, 3:24am UTC](https://discuss.elastic.co/t/connect-to-a-remote-server-via-ssh-using-elasticsearch-package-node-js/125842/1 "2018-03-28T03:24:17Z")

</div>

I'm currently using Node's `elasticsearch` package. Until now, I connected to the ES instance in the following way.

```
let esClient = new elasticsearch.Client({
        host: '127.0.0.1:9200',
        log: 'trace'
});

```

Now, I've installed ES on a remote Amazon EC2 Linux server by tunneling through SSH using a key file.  
I've done the basic ES installation and setup on that server. Tested it as well, and it runs properly.

I've now deployed my Node project on a Server X (EC2 - Ubuntu server).  
And Elasticsearch is on Server Y(EC2 - Amazon Linux server).

Apart from specifying the IP in the `host` parameter what else do I need to connect to ES running on Server Y from Server X?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 25, 2018, 3:24am UTC](https://discuss.elastic.co/t/connect-to-a-remote-server-via-ssh-using-elasticsearch-package-node-js/125842/2 "2018-04-25T03:24:19Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
