# Can I move discourse out of the default docker bridge network?

**URL:** <https://meta.discourse.org/t/can-i-move-discourse-out-of-the-default-docker-bridge-network/202014>\
**Category:** Product Support\
**Created:** [August 28, 2021, 9:28pm UTC](https://meta.discourse.org/t/can-i-move-discourse-out-of-the-default-docker-bridge-network/202014 "2021-08-28T21:28:04Z")\
**Posts on this page:** 4\
**Page:** 1

## AI-generated summary

[tophee](/t/-/202014/1) is seeking to move their Discourse instance from the default Docker bridge network to a custom network. [pfaffman](/t/-/202014/2) suggests adding a `docker-args` stanza with the custom network name, such as `--network web`. [tophee](/t/-/202014/3) is concerned about potential issues, but [pfaffman](/t/-/202014/4) confirms that this setup works fine with their Traefik config. Additionally, [pfaffman](/t/-/202014/4) notes that using websockets with an outer proxy may render the network change unnecessary, as sockets are not affected by Docker networks.

<div class="post-metadata">

**Author:** ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)\
**Post date:** [August 28, 2021, 9:28pm UTC](https://meta.discourse.org/t/can-i-move-discourse-out-of-the-default-docker-bridge-network/202014/1 "2021-08-28T21:28:05Z")

</div>

When following the default discourse install process, discourse will run on the default docker bridge network. Is it safe to move it into a custom network without any problems and if so, how do I do it so that it persists across rebuilds?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [September 1, 2021, 5:58pm UTC](https://meta.discourse.org/t/can-i-move-discourse-out-of-the-default-docker-bridge-network/202014/2 "2021-09-01T17:58:02Z")

</div>

I think all you need to do is add a `docker-args` stanza with the stuff you want, something like

```plaintext
docker_args: |
  --network web

```

I put it after `links` in my setup.

---

<div class="post-metadata">

**Author:** ![tophee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tophee/32/73406_2.png) [@tophee](https://meta.discourse.org/u/tophee)\
**Post date:** [September 1, 2021, 6:02pm UTC](https://meta.discourse.org/t/can-i-move-discourse-out-of-the-default-docker-bridge-network/202014/3 "2021-09-01T18:02:22Z")

</div>

> [@pfaffman](#):
>
> I put it after `links` in my setup.

So you did switch the network and everything works find? That would be great!

That said: [it occurred to me just a few minutes ago](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247/406) that I may not even need to change the network since I’m using the websocket with an outer proxy. Is my hunch correct that the websocket circumvents the docker network anyway?

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [September 1, 2021, 6:18pm UTC](https://meta.discourse.org/t/can-i-move-discourse-out-of-the-default-docker-bridge-network/202014/4 "2021-09-01T18:18:39Z")

</div>

> [@tophee](#):
>
> So you did switch the network and everything works

Yes. My traefik config uses this and it works fine.

> [@tophee](#):
>
> I may not even need to change the network since I’m using the websocket with an outer proxy.

Yeah. I’m pretty sure that sockets don’t care about docker networks.
