# Unable to connect dockerized simulation

**URL:** <https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048>\
**Category:** QGroundControl\
**Created:** [May 2, 2023, 4:06pm UTC](https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048 "2023-05-02T16:06:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lukas](https://discuss.px4.io/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@Lukas](https://discuss.px4.io/u/Lukas)\
**Post date:** [May 2, 2023, 4:06pm UTC](https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048/1 "2023-05-02T16:06:59Z")

</div>

Hi, I have created docker image with simulation. It runs fine, I can run the docker with docker run --rm -it -p 18570:18570/udp \<docker\_image\> and I can control the drone from the command line. But I am unable to connect with QGroundControl. I start the docker, then I start the QGC and it does not connect, which should be fine. But I cannot connect even when I go to app settings/comm links and I create a link using  
UDP  
port: 18570  
when I click connect using this created link nowhting happens and QGC stil says Disconnected.  
and I am not sure if I should create that server with docker image IP or not? I am on Ubuntu 22.04 in docker and on host.  
I have found this [Cannot enable MAV\_{i}\_BROADCAST](https://discuss.px4.io/t/cannot-enable-mav-i-broadcast/22408), but I dont know how to put that -p parameter to be enabled always when I do make px4 build? just how to enable it as default and I even dont know if that is the solution of my issue?  
Can anyone help? Please? I am really confused here.

---

<div class="post-metadata">

**Author:** ![JulianOes](https://discuss.px4.io/user_avatar/discuss.px4.io/julianoes/32/30_2.png) [@JulianOes](https://discuss.px4.io/u/JulianOes)\
**Post date:** [May 2, 2023, 7:27pm UTC](https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048/2 "2023-05-02T19:27:31Z")

</div>

Have a look how it’s done here: [GitHub - JonasVautherin/px4-gazebo-headless: An unofficial Ubuntu-based container building and running PX4 SITL (Software In The Loop) through gazebo.](https://github.com/JonasVautherin/px4-gazebo-headless)

---

<div class="post-metadata">

**Author:** ![Lukas](https://discuss.px4.io/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@Lukas](https://discuss.px4.io/u/Lukas)\
**Post date:** [May 2, 2023, 7:41pm UTC](https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048/3 "2023-05-02T19:41:38Z")

</div>

@JulianOes - I know that image, but I dont understand it… ☹ I do not understand that part with proxies. Can you little explain?  
It should be stright forward based on documentation, just run the docker image and connect to exposed port from QGC. Only thing is, it does not work… ☹ Or I do something wrong.

---

<div class="post-metadata">

**Author:** ![Lukas](https://discuss.px4.io/letter_avatar_proxy/v4/letter/l/e9a140/32.png) [@Lukas](https://discuss.px4.io/u/Lukas)\
**Post date:** [May 2, 2023, 8:48pm UTC](https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048/4 "2023-05-02T20:48:53Z")

</div>

It seems I have got it 🙂 , the exposed port from docker has to be 18570 and then the QGC has to be set :  
port = 15871 (just some free port)  
and server has to be set 0.0.0.0:18570 - the server ip, is the localhost

---

<div class="post-metadata">

**Author:** ![HopeCollector](https://discuss.px4.io/user_avatar/discuss.px4.io/hopecollector/32/13387_2.png) [@HopeCollector](https://discuss.px4.io/u/HopeCollector)\
**Post date:** [July 1, 2025, 5:55am UTC](https://discuss.px4.io/t/unable-to-connect-dockerized-simulation/32048/5 "2025-07-01T05:55:31Z")

</div>

> port = 15871 (just some free port)

This sentence is the most important, it saved my whole day 🎉🎉🎉
