# How to connect to a remote host using influxdb Python client

**URL:** <https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223>\
**Category:** Welcome & Getting Started\
**Tags:** influxdb, python\
**Created:** [October 6, 2020, 6:41am UTC](https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223 "2020-10-06T06:41:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ThePheonix](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/thepheonix/32/4216_2.png) [@ThePheonix](https://community.influxdata.com/u/ThePheonix)\
**Post date:** [October 6, 2020, 6:41am UTC](https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223/1 "2020-10-06T06:41:53Z")

</div>

Hello Everyone,

I just started using influxdb and I’m trying to figure things out. I would like to access a remote host. I know I should use the following command. but I don’t know how to get the port, url or host of the remote server.

client = InfluxDBClient(host=‘10.x.x.x’, port=7086, username=‘user of host server’, password=‘p/w of host server’, database=‘test\_hd’)

Could someone please help me 🙂

---

<div class="post-metadata">

**Author:** ![James\_Paige](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/james_paige/32/5241_2.png) [@James\_Paige](https://community.influxdata.com/u/James_Paige)\
**Post date:** [October 6, 2020, 6:45pm UTC](https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223/2 "2020-10-06T18:45:09Z")

</div>

Is the server your own local influxdb server that you installed yourself?  
If so, you probably want host=‘localhost’ and port=8086

If it is someone else’s influxdb server, then you need to ask them. We couldn’t even begin to guess.

---

<div class="post-metadata">

**Author:** ![ThePheonix](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/thepheonix/32/4216_2.png) [@ThePheonix](https://community.influxdata.com/u/ThePheonix)\
**Post date:** [October 6, 2020, 7:11pm UTC](https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223/3 "2020-10-06T19:11:05Z")

</div>

Hi @James_Paige… Thanks for your answer.  
I would like to access and query some data from an Influxdb on a remote server(it’s someone else’s influxdb). I can access the remote server using the teamviewer and I got the Hostname/IP adress of the remote server. I am still getting some permission error, once I try to access influxdb. so I’m not sure how I can give myself the permission to access the influxdb remote server from my local server.  
Do you have any ideas? Should I enable or change something in the influxdb configuration file?

---

<div class="post-metadata">

**Author:** ![James\_Paige](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/james_paige/32/5241_2.png) [@James\_Paige](https://community.influxdata.com/u/James_Paige)\
**Post date:** [October 6, 2020, 7:48pm UTC](https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223/4 "2020-10-06T19:48:04Z")

</div>

If it is definitely a permission error, then you need to set up a username and password, or use the root username and password. Those are set up on the influxdb command line, not the config file.

If you are getting a timeout, maybe you don’t have a network connection to the influxdb server’s port. You should definitely not assume that having Teamviewer access will give you access to every port on a remote server.

---

<div class="post-metadata">

**Author:** ![BlueCorn](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/bluecorn/32/5747_2.png) [@BlueCorn](https://community.influxdata.com/u/BlueCorn)\
**Post date:** [October 13, 2020, 11:19pm UTC](https://community.influxdata.com/t/how-to-connect-to-a-remote-host-using-influxdb-python-client/16223/5 "2020-10-13T23:19:48Z")

</div>

We do this all the time. Your InfluxDBClient initialization looks correct. However, if an SSL connection is required, you will want to use the following information in the “constructor”:

host=\<ip\_addr\>  
port=443  
username=’user\_name’  
password=’user\_password’  
database=’test\_hd’  
ssl=True  
path=’influxdb’

I hope this info helps. (If this doesn’t work, then I’m all out of ideas…)
