# Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

**URL:** https://discuss.elastic.co/t/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-unix-var-run-docker-sock/307692
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [June 20, 2022, 7:53pm UTC](https://discuss.elastic.co/t/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-unix-var-run-docker-sock/307692 "2022-06-20T19:53:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)
#### Post date: [June 20, 2022, 7:53pm UTC](https://discuss.elastic.co/t/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-unix-var-run-docker-sock/307692/1 "2022-06-20T19:53:23Z")

</div>

Hello World!

I'm trying to [Run Filebeat on Docker | Filebeat Reference [7.17] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/7.17/running-on-docker.html#running-on-docker) yet running into following issue:

```auto
% docker-compose logs --tail 2 filebeat
filebeat | 2022-06-20T19:05:12.965Z ERROR instance/beat.go:1014 Exiting: error in autodiscover provider settings: error setting up docker autodiscover provider: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": dial unix /var/run/docker.sock: connect: permission denied
filebeat | Exiting: error in autodiscover provider settings: error setting up docker autodiscover provider: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": dial unix /var/run/docker.sock: connect: permission denied
%

```

I use these:

- [\_volume\_mounted\_configuration](https://www.elastic.co/guide/en/beats/filebeat/7.17/running-on-docker.html#_volume_mounted_configuration)
- [\_example\_configuration\_file](https://www.elastic.co/guide/en/beats/filebeat/7.17/running-on-docker.html#_example_configuration_file)

* * *

> Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info"

perhaps somewhere here, instead of using `/var/run/docker.sock`, _filebeat_ adds somewhere `http://` in front of it, and that's causing an issue and I can't find where is it..

Please advise.  
Thank you in advance!

---

<div class="post-metadata">

### Author: ![alexus](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexus/32/12696_2.png) [@alexus](https://discuss.elastic.co/u/alexus)
#### Post date: [July 13, 2022, 5:31pm UTC](https://discuss.elastic.co/t/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-unix-var-run-docker-sock/307692/2 "2022-07-13T17:31:03Z")

</div>

I also get same behavior with metricbeat as well

```auto
# docker compose logs --tail 1
metricbeat | 2022-07-13T17:27:55.428Z	ERROR	[docker]	event/event.go:109	Error watching for docker events: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/events?since=1657729811": dial unix /var/run/docker.sock: connect: permission denied
#

```

---

<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: [August 10, 2022, 7:31pm UTC](https://discuss.elastic.co/t/got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket-at-unix-var-run-docker-sock/307692/3 "2022-08-10T19:31:50Z")

</div>

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