# Installing Sensu in Docker Desktop on Windows 10

**URL:** <https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440>\
**Category:** Getting Started\
**Created:** [February 9, 2021, 8:01am UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440 "2021-02-09T08:01:18Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimbju](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jimbju/32/545_2.png) [@jimbju](https://discourse.sensu.io/u/jimbju)\
**Post date:** [February 9, 2021, 8:01am UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440/1 "2021-02-09T08:01:18Z")

</div>

Hi,

I’ve followed the installation guide for docker ([Install Sensu - Sensu Docs](https://docs.sensu.io/sensu-go/latest/operations/deploy-sensu/install-sensu)).  
I executed the “configure and start” command:

> docker run -v /var/lib/sensu:/var/lib/sensu   
> -d --name sensu-backend   
> -p 3000:3000 -p 8080:8080 -p 8081:8081   
> -e SENSU\_BACKEND\_CLUSTER\_ADMIN\_USERNAME=admin   
> -e SENSU\_BACKEND\_CLUSTER\_ADMIN\_PASSWORD=admin   
> sensu/sensu:latest   
> sensu-backend start --state-dir /var/lib/sensu/sensu-backend --log-level debug

Now, when I try to login to the web UI it says: Bad username or password.

curl [http://127.0.0.1:8080/health](http://127.0.0.1:8080/health) gives me:  
{“Alarms”:null,“ClusterHealth”:[{“MemberID”:17176087798454692206,“MemberIDHex”:“ee5db8d991d0296e”,“Name”:“default”,“Err”:“context deadline exceeded”,“Healthy”:false}],“Header”:{“cluster\_id”:8120212534602823810,“member\_id”:17176087798454692206,“raft\_term”:10}}

I don’t know where to start looking for misconfigurations, any help greatly appreciated!

Best regards,  
Jim

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [February 10, 2021, 12:33am UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440/2 "2021-02-10T00:33:02Z")

</div>

Hey,

So best thing to do when troubleshooting a docker container is to use `docker logs <container-id>`  
in this case `docker logs sensu-backend`

You may be able to find an error message that gives you some insight.

But in this case, If I were a betting man… I’d bet you a doughnut the volume mount option is probably the problem. It could be that you are trying to volume mount a directory from the host system `/var/lib/sensu` to act as `/var/lib/sensu` in the container that you don’t have write permissions to or does not exist. You may need to adjust the volume mount argument in the example command to work for you Windows system. I can’t tell you what that argument should be, it just needs to be a directory you can write to so docker can mount it and use it to persist database information to.

You can start by just removing the `-v /var/lib/sensu:/var/lib/sensu` and see if that lets you get unstuck.  
But ideally, you’ll want a persistent volume mount for `/var/lib/sensu` as this holds the backing store database for etcd, for your configuration. If you don’t have a persistent mount for this directory, you’ll lose state when you destroy the container (essentially losing all the work you did to configure your sensu resources…so having a persistent volume mount for that directory is very useful).

I hope this helps.

---

<div class="post-metadata">

**Author:** ![jimbju](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jimbju/32/545_2.png) [@jimbju](https://discourse.sensu.io/u/jimbju)\
**Post date:** [February 10, 2021, 11:19am UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440/3 "2021-02-10T11:19:52Z")

</div>

Hi,

Thanks a lot for your reply!

I removed everything from docker desktop (clean/purge data) in order to start over from scratch.

I tried both removing the `-v /var/lib/sensu:/var/lib/sensu` from the command and replacing `/var/lib/sensu` with `c:/data/` (i.e. `-v c:/data/:/var/lib/sensu`). Unfortunately neither made any difference.

> C:\>docker run -v c:/data/:/var/lib/sensu -d --name sensu-backend -p 3000:3000 -p 8080:8080 -p 8081:8081 -e SENSU\_BACKEND\_CLUSTER\_ADMIN\_USERNAME=admin -e SENSU\_BACKEND\_CLUSTER\_ADMIN\_PASSWORD=admin sensu/sensu:latest sensu-backend start --state-dir /var/lib/sensu/sensu-backend --log-level debug  
> Unable to find image ‘sensu/sensu:latest’ locally  
> latest: Pulling from sensu/sensu  
> 801bfaa63ef2: Pull complete 9916937d4d7c: Pull complete b0ddb18de775: Pull complete 63dd41191df7: Pull complete 99cf7622423f: Pull complete ca20dd78c5f6: Pull complete bd394dba1b3b: Pull complete 6bfaaaf12c49: Pull complete 41ebf0bdd4e5: Pull complete ef69dc59b9b7: Pull complete e9d339c32565: Pull complete 6260987306ad: Pull complete 885a479632ee: Pull complete 2d9c19fd7181: Pull complete 335c077337f0: Pull complete 8778efe10a24: Pull complete 4461b3f18ed7: Pull complete 3668a70bca0a: Pull complete ee987af2cdb9: Pull complete 0897e3d3ac24: Pull complete Digest: sha256:bb185f0b3024387d4701a549b232bd2178ddb88ba84fef04b1c3d0ba8fcbee51  
> Status: Downloaded newer image for sensu/sensu:latest  
> c1503c283ad0415a7b6a999a774f35918dd8f8af7751eb450207a1e233b4f964
> 
> C:\>dir c:\data  
> Volume in drive C is OSDisk  
> Volume Serial Number is F453-7A41
> 
> Directory of c:\data
> 
> 2021-02-10 12:10 .  
> 2021-02-10 12:10 …  
> 2021-02-10 12:10 sensu-backend  
> 0 File(s) 0 bytes  
> 3 Dir(s) 613 803 483 136 bytes free
> 
> C:\>curl removed:8080/health  
> {“Alarms”:null,“ClusterHealth”:[{“MemberID”:10659232868307291187,“MemberIDHex”:“93ed33d1959fcc33”,“Name”:“default”,“Err”:“context deadline exceeded”,“Healthy”:false}],“Header”:{“cluster\_id”:7818060805654690495,“member\_id”:10659232868307291187,“raft\_term”:2}}
> 
> C:\>curl [http://127.0.0.1:8080/version](http://127.0.0.1:8080/version)  
> {“etcd”:{“etcdserver”:“3.3.22”,“etcdcluster”:“3.3.0”},“sensu\_backend”:“6.2.5”}

`docker logs sensu-backend` gives me the following output: [gist:8b9d9709198a8cf9eccef758b449d833 · GitHub](https://gist.github.com/jimbju/8b9d9709198a8cf9eccef758b449d833#file-gistfile1-txt)

Thanks again for helping out!

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [February 10, 2021, 7:21pm UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440/4 "2021-02-10T19:21:29Z")

</div>

Hmm,  
the logs definitely indicate there is a problem with the embedded etcd service coming up…which is unexpected.  
I’ll dig up a windows 10 with docker tonight and try to reproduce.

Running docker my Fedora desktop just works…so I’m a little surprised this is falling over on Docker on Windows. It should just work.

How well do you know how to inspect a running docker container using the docker cmdline tool?  
I think docker inspect will let you get the details … id be interested to see if docker sees tcp 2379 port is as exposed inside the service.

output of `docker inspect sensu-backend` has all the info.  
Be careful about posting that… it has ENV secrets…so  
you are looking for a section called ‘ExposedPorts’  
should look like this.

```auto
                "2379/tcp": {},
                "2380/tcp": {},
                "3000/tcp": {},
                "8080/tcp": {},
                "8081/tcp": {}
            },

```

Thats all the tcp ports sensu-backend is using inside the container… embedded etcd (client and peer), web-ui, api, agent websocket

---

<div class="post-metadata">

**Author:** ![jspaleta](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jspaleta/32/141_2.png) [@jspaleta](https://discourse.sensu.io/u/jspaleta)\
**Post date:** [February 11, 2021, 5:04am UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440/5 "2021-02-11T05:04:10Z")

</div>

Hey,  
So i just did a fresh instal of Docker for Windows 10 Pro,  
The sensu instructions minus the volume mount argument definitely worked as I expected.  
I was able to get to the dashboard just fine

Not sure what to tell you, it;s probably something in your docker setup but since I didn’t hit the problem myself its gonna be difficult for me to give you a good idea where to look. I think docker on windows is already sort of a special kinda magic, since there is a linux kernel somewhere deep in the guts of this.

I will say that when I installed the latest Docker for Windows it required me to install the WSL 2 components and do a couple of restarts of the OS before it was usable at all. But once I was able to run the Docker for Windows provided tutorial, the sensu backend install worked as I expected.

---

<div class="post-metadata">

**Author:** ![jimbju](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.sensu.io/jimbju/32/545_2.png) [@jimbju](https://discourse.sensu.io/u/jimbju)\
**Post date:** [February 12, 2021, 6:51am UTC](https://discourse.sensu.io/t/installing-sensu-in-docker-desktop-on-windows-10/2440/6 "2021-02-12T06:51:29Z")

</div>

Hi again,

Thanks _again_ for taking the time to help out! When looking at the output of `docker inspect sensu-backend` everything looks perfectly fine. I’m guessing something is wrong with my Win 10 + docker desktop + wsl - combo. I think I’ll resort to setting this up in a linux VM instead. I’ll keep in mind to post here if I’ll ever find out what was the cause of the issue.  
Thanks!

Best regards,  
Jim
