# About Dashboard inside Docker

**URL:** <https://discuss.ray.io/t/about-dashboard-inside-docker/4065>\
**Category:** Dashboard, Monitoring & Debugging\
**Created:** [November 8, 2021, 2:02pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065 "2021-11-08T14:02:02Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [November 8, 2021, 2:02pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/1 "2021-11-08T14:02:02Z")

</div>

Hi, I met a problem when running a ray program in docker and checking the dashboard in the host.

1. I run a docker with `docker run -p 9999:9999` option.
2. I use `ray.init(dashboard_port=9999,dashboard_host='0.0.0.0')` in the docker and the console prints `INFO services.py:1270 -- View the Ray dashboard at http://172.17.0.2:9999`, which is expected.
3. In the docker I check the dashboard is working:

```auto
root@03dc0ca63666:/home/game# lsof -i:9999
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
python3 192 root 27u IPv4 165722973 0t0 TCP *:9999 (LISTEN) 

```

1. Now I want to check the dashboard in the host. If all works right, I could open `localhost:9999` in the host. However, it failed, and on host I check whether the port forwarding succeed. `lsof -i:9999` gives empty output.  
Besides, I use `docker ps` to confirm that:

```auto
$docker ps
fd54703aabb2 test "bash" About a minute ago Up About a minute 0.0.0.0:8265->8265/tcp, :::8265->8265/tcp 

```

I am using:

```auto
pip install ray[default] -i https://pypi.tuna.tsinghua.edu.cn/simple #(ray==1.8.0)
pip install 'aiohttp<3.8' -i https://pypi.tuna.tsinghua.edu.cn/simple

```

to avoid other issues.

Does anyone know what might go wrong here? Or how do you guys check the dashboard when running ray in the docker? Any comments are welcomed!

---

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [November 11, 2021, 1:30am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/2 "2021-11-11T01:30:14Z")

</div>

Hi, guys. Please feel free free to leave any comments

---

<div class="post-metadata">

**Author:** ![puntime\_error](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/puntime_error/32/502_2.png) [@puntime\_error](https://discuss.ray.io/u/puntime_error)\
**Post date:** [November 15, 2021, 6:58pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/3 "2021-11-15T18:58:45Z")

</div>

Are you binding the host:container ports so that port 9999 is exposed to the host? What does your docker run command look like or your docker compose?

---

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [November 16, 2021, 1:45am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/4 "2021-11-16T01:45:04Z")

</div>

Hi Sir, thanks for the reply!  
I run a docker with `docker run -p 9999:9999` option. Also, `docker ps` in the host gives:

```auto
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a92c0414d070 hnb "bash" 4 days ago Up 4 days 0.0.0.0:9999->9999/tcp, ::::9999->9999/tcp hnb

```

I suppose that means I have successfully export the docker port to the corresponding host port. I wonder if I make something wrong!

---

<div class="post-metadata">

**Author:** ![puntime\_error](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/puntime_error/32/502_2.png) [@puntime\_error](https://discuss.ray.io/u/puntime_error)\
**Post date:** [November 16, 2021, 5:07pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/5 "2021-11-16T17:07:35Z")

</div>

oddly enough I’m seeing something similar, even on the default port 8265 and if I try to access the ray dashboard, I get an ERR\_CONNECTION\_RESET in both docker and without docker

---

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [November 17, 2021, 7:37am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/6 "2021-11-17T07:37:00Z")

</div>

That sounds not good. Hope guys from the Ray team could give some suggestions.

---

<div class="post-metadata">

**Author:** ![puntime\_error](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/puntime_error/32/502_2.png) [@puntime\_error](https://discuss.ray.io/u/puntime_error)\
**Post date:** [December 8, 2021, 6:52pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/7 "2021-12-08T18:52:02Z")

</div>

@LoveRay I had to downgrade from aioredis 2.0.0 to aioredis@1.3.1 and then when I cleared by browser cache, I was able to get the dashboard to work again. YMMV, bu hope that helps or gives you something else to try

Also, I upgraded to ray 1.9

---

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [December 9, 2021, 3:17am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/8 "2021-12-09T03:17:24Z")

</div>

@puntime_error Thanks for the reply. I have confirmed that worked. The only strange thing is even if I could access `host_ip:9999` for the dashboard, `lsof -i:9999` gives nothing. But anyway, this is the workout.

---

<div class="post-metadata">

**Author:** ![Jerry\_Yao](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jerry_yao/32/2028_2.png) [@Jerry\_Yao](https://discuss.ray.io/u/Jerry_Yao)\
**Post date:** [January 22, 2022, 2:06pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/9 "2022-01-22T14:06:28Z")

</div>

> [@LoveRay](#):
>
> worke

I encounter the same question. I construct a on-primise cluster with two physical servers. docker ray-head is run on server one, and docker ray-worker is run on server two. I build network connection by docker swarm. and I can get cluster information by command “ray status”. But I cannot visit Ray web UI when I enter http://:8265 on my laptop chrome  
I make the port map too.  
But if when I run container without “–network” configuation, I can see Ray web UI, in that case , my other server cannot join the Ray cluster.  
Is there any help?  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [January 26, 2022, 7:15am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/10 "2022-01-26T07:15:59Z")

</div>

Sorry Sir, I am not familiar with the networking part. Maybe cc @puntime_error has some suggestions?

---

<div class="post-metadata">

**Author:** ![puntime\_error](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/puntime_error/32/502_2.png) [@puntime\_error](https://discuss.ray.io/u/puntime_error)\
**Post date:** [February 16, 2022, 9:15pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/11 "2022-02-16T21:15:21Z")

</div>

@LoveRay and @zhonglism (saw your other post), I FINALLY got the dashboard and the metrics working in my env. I had to manually install the deps listed in \<python\_install\>/site-packages/ray/dashboard/optional\_deps.py

I didn’t need to install all of them, but add to install aiohttp\_cors, prometheus\_client, opencensus after that I could see get to the dashboard…ymmv, but good luck

---

<div class="post-metadata">

**Author:** ![LoveRay](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/loveray/32/1450_2.png) [@LoveRay](https://discuss.ray.io/u/LoveRay)\
**Post date:** [February 18, 2022, 3:44am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/12 "2022-02-18T03:44:24Z")

</div>

Got it. Thanks Ser. Maybe Ray team should mention it in the docs.

---

<div class="post-metadata">

**Author:** ![Huaiwei\_Sun](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/huaiwei_sun/32/1316_2.png) [@Huaiwei\_Sun](https://discuss.ray.io/u/Huaiwei_Sun)\
**Post date:** [October 11, 2022, 2:47am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/13 "2022-10-11T02:47:40Z")

</div>

In Ray 2.0, we made the previous experimental dashboard the new default dashboard. Are you still running into the same issue?

---

<div class="post-metadata">

**Author:** ![erezinman](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/erezinman/32/4497_2.png) [@erezinman](https://discuss.ray.io/u/erezinman)\
**Post date:** [June 20, 2023, 10:55am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/14 "2023-06-20T10:55:06Z")

</div>

@Huaiwei_Sun I can confirm that the problem persists with ray 2.5.0: Exposing ports and mapping them outside of the docker results in “The connection was reset” in Firefox. The problem also persists when installing the optional dependencies for the dashboard. Interestingly enough, the problem is solved when using the `--network host` flag in `docker run`, but that is applicable only in very specific cases.

[This](https://stackoverflow.com/a/60984025) answer from SO suggests that it might have to do with the HTTP server technology/isolation level, but I have nearly 0 knowledge on the subject.

---

<div class="post-metadata">

**Author:** ![tipmethewink](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@tipmethewink](https://discuss.ray.io/u/tipmethewink)\
**Post date:** [August 20, 2024, 6:15am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/15 "2024-08-20T06:15:34Z")

</div>

I couldn’t find an answer to this so for anyone that stumbles upon this issue: adding `--dashboard-host 0.0.0.0` to my `ray start...` command in my container solved the issue.

---

<div class="post-metadata">

**Author:** ![Sam\_Chan](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sam_chan/32/5011_2.png) [@Sam\_Chan](https://discuss.ray.io/u/Sam_Chan)\
**Post date:** [August 20, 2024, 4:44pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/16 "2024-08-20T16:44:04Z")

</div>

@tipmethewink what Ray version were you on?

---

<div class="post-metadata">

**Author:** ![tipmethewink](https://avatars.discourse-cdn.com/v4/letter/t/b782af/32.png) [@tipmethewink](https://discuss.ray.io/u/tipmethewink)\
**Post date:** [August 20, 2024, 8:36pm UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/17 "2024-08-20T20:36:34Z")

</div>

2.34.0

I wrote a comprehensive post with details of my compose file and log excepts but as I’m new here it disallowed it. I’ve cut and paste the bits it didn’t moan about l:

My compose entry for ray looks like this:

ray:  
image: python:3.11  
…  
ports:

- 8265:8265
- 10001:10001  
command: ‘sh -c "ray stop && ray start --head --block --num-cpus=1 --resources=’‘{"trade\_data": 64}’’ -v --dashboard-host 0.0.0.0"’

Without the --dashboard-host option it listens on localhost and accepts the connection but immediately drops it. With the option above, it binds to the container network interface and works as you’d expect.

---

<div class="post-metadata">

**Author:** ![Islam\_Ahmed\_bassuni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/islam_ahmed_bassuni/32/6499_2.png) [@Islam\_Ahmed\_bassuni](https://discuss.ray.io/u/Islam_Ahmed_bassuni)\
**Post date:** [September 3, 2024, 9:20am UTC](https://discuss.ray.io/t/about-dashboard-inside-docker/4065/18 "2024-09-03T09:20:54Z")

</div>

You need to pass this to ray start:  
–dashboard-host 0.0.0.0  
Reasons:

- [How to correctly build a Ray Serve server in Docker with a generic Ubuntu image (x86\_64 in an amd system)?](https://discuss.ray.io/t/how-to-correctly-build-a-ray-serve-server-in-docker-with-a-generic-ubuntu-image-x86-64-in-an-amd-system/15336)
- [networking - What's the difference between 127.0.0.1 and 0.0.0.0? - Super User](https://superuser.com/questions/949428/whats-the-difference-between-127-0-0-1-and-0-0-0-0)  
Seems like it should be default in Ray but this is not the case for some reason
