# Tried to configure the drone server and runner locally using localhost but the runner cannot ping the server

**URL:** https://drone.discourse.group/t/tried-to-configure-the-drone-server-and-runner-locally-using-localhost-but-the-runner-cannot-ping-the-server/11808
**Category:** Drone Support
**Tags:** basic
**Created:** [March 16, 2022, 9:24pm UTC](https://drone.discourse.group/t/tried-to-configure-the-drone-server-and-runner-locally-using-localhost-but-the-runner-cannot-ping-the-server/11808 "2022-03-16T21:24:47Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Aabhusan](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/aabhusan/32/5561_2.png) [@Aabhusan](https://drone.discourse.group/u/Aabhusan)
#### Post date: [March 16, 2022, 9:24pm UTC](https://drone.discourse.group/t/tried-to-configure-the-drone-server-and-runner-locally-using-localhost-but-the-runner-cannot-ping-the-server/11808/1 "2022-03-16T21:24:47Z")

</div>

i tried to do it in localhost

server  
docker run  
–volume=/var/lib/drone:/data  
–env=DRONE\_GITHUB\_CLIENT\_ID=6bf45dfd211c16111b84  
–env=DRONE\_GITHUB\_CLIENT\_SECRET=070fc6469280eca0601784f603ada7db4df41faa  
–env=DRONE\_RPC\_SECRET=2c44c6658b577199210dc7b193f11d96  
–env=DRONE\_SERVER\_HOST=localhost  
–env=DRONE\_SERVER\_PROTO=https  
–publish=80:80  
–publish=443:443  
–restart=always  
–detach=true  
–name=drone  
drone/drone:2

runner

docker run --detach  
–volume=/var/run/docker.sock:/var/run/docker.sock  
–env=DRONE\_RPC\_PROTO=https  
–env=DRONE\_RPC\_HOST=localhost  
–env=DRONE\_RPC\_SECRET=2c44c6658b577199210dc7b193f11d96  
–env=DRONE\_RUNNER\_CAPACITY=2  
–env=DRONE\_RUNNER\_NAME=my-first-runner  
–publish=3000:3000  
–restart=always  
–name=runner  
drone/drone-runner-docker:1

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/testdrone/original/2X/b/b8f2972a4d21a553f8a7ac347ec73f93ad81c39f.png)

---

<div class="post-metadata">

### Author: ![drone](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/drone/32/6956_2.png) [@drone](https://drone.discourse.group/u/drone)
#### Post date: [March 16, 2022, 11:13pm UTC](https://drone.discourse.group/t/tried-to-configure-the-drone-server-and-runner-locally-using-localhost-but-the-runner-cannot-ping-the-server/11808/2 "2022-03-16T23:13:55Z")

</div>

The reason this does not work is because container networks are completely isolated which means the server and runner are on completely separate networks. This means `localhost` refers to the network inside the runner container; the server is not running inside the runner container which is why you cannot use localhost to connect.

If you want to run the server and runner containers on the same machine, and have them communicate, you need to use docker networking:  
[https://docs.docker.com/config/containers/container-networking/](https://docs.docker.com/config/containers/container-networking/)

We also provide a docker-compose file that you can use as reference, but you would still need an understanding of docker networking in order to modify to meet your needs:  
[https://github.com/harness/drone/blob/master/docker/compose/drone-github/docker-compose.yml](https://github.com/harness/drone/blob/master/docker/compose/drone-github/docker-compose.yml)

---

<div class="post-metadata">

### Author: ![Aabhusan](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/aabhusan/32/5561_2.png) [@Aabhusan](https://drone.discourse.group/u/Aabhusan)
#### Post date: [March 19, 2022, 5:50pm UTC](https://drone.discourse.group/t/tried-to-configure-the-drone-server-and-runner-locally-using-localhost-but-the-runner-cannot-ping-the-server/11808/3 "2022-03-19T17:50:42Z")

</div>

thank you for your response. I used ngrok for configuring runner and server in the local machine. now it is running fine and runner is able to ping the server
