# NixOs + Docker Swarm

**URL:** https://discourse.vpsfree.cz/t/nixos-docker-swarm/300
**Category:** Help
**Created:** [February 12, 2025, 8:17pm UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300 "2025-02-12T20:17:22Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![flpvsk](https://discourse.vpsfree.cz/user_avatar/discourse.vpsfree.cz/flpvsk/32/107_2.png) [@flpvsk](https://discourse.vpsfree.cz/u/flpvsk)
#### Post date: [February 12, 2025, 8:17pm UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/1 "2025-02-12T20:17:22Z")

</div>

I can’t seem to figure out how to deploy a docker stack to NixOs on the VPS. The service fails to start with an error:

> network sandbox join failed: subnet sandbox join failed for “10.0.0.0/24”: error creating vxlan interface: operation not supported

Docker-related nix config:

```auto
virtualisation.docker.enable = true;
virtualisation.docker.rootless.enable = false;

```

Container is a simple web app that uses a port binding.

---

<div class="post-metadata">

### Author: ![snajpa](https://discourse.vpsfree.cz/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@snajpa](https://discourse.vpsfree.cz/u/snajpa)
#### Post date: [February 12, 2025, 11:22pm UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/2 "2025-02-12T23:22:16Z")

</div>

any debug output? why is it using vxlan? how is it trying to use vxlan specifically?

---

<div class="post-metadata">

### Author: ![flpvsk](https://discourse.vpsfree.cz/user_avatar/discourse.vpsfree.cz/flpvsk/32/107_2.png) [@flpvsk](https://discourse.vpsfree.cz/u/flpvsk)
#### Post date: [February 13, 2025, 10:13am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/3 "2025-02-13T10:13:42Z")

</div>

I’m trying to run a container in a swarm, so I’m running

```auto
docker swarm init
docker stack deploy -c <docker-compose.yml> <stack_name>

```

Not sure why it is using vxlan. Where can I find debug logs in this case?

---

<div class="post-metadata">

### Author: ![snajpa](https://discourse.vpsfree.cz/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@snajpa](https://discourse.vpsfree.cz/u/snajpa)
#### Post date: [February 13, 2025, 10:37am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/4 "2025-02-13T10:37:33Z")

</div>

> Not sure why it is using vxlan. Where can I find debug logs in this case?

Not a good answer if you want me to help you with this. 🙂 I’m not using Docker. Nobody in our core team is, that technology doesn’t make sense to us. I personally hate debugging the golang spaghetti. If you want to get this running, you’re going to need to invest more time in it. I will fix whatever I can fix, but I need to know what to fix - and I’m not spending days on debugging this when everyone else’s setup works, sorry.

---

<div class="post-metadata">

### Author: ![snajpa](https://discourse.vpsfree.cz/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@snajpa](https://discourse.vpsfree.cz/u/snajpa)
#### Post date: [February 13, 2025, 10:57am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/5 "2025-02-13T10:57:25Z")

</div>

> [@flpvsk](#):
>
> error creating vxlan interface: operation not supported

```auto
[CT 26788] root@llamatest:~# ip link add vxlan0 type vxlan id 100 group 239.1.1.1 dev venet0 dstport 4789

[CT 26788] root@llamatest:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ip6tnl0@NONE: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/tunnel6 :: brd :: permaddr 7e8c:933f:f1ad::
3: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/gre 0.0.0.0 brd 0.0.0.0
4: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
5: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
6: tunl0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
7: venet0@if136: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether de:9e:82:6f:2f:d0 brd ff:ff:ff:ff:ff:ff link-netnsid 0
8: cni-podman0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 02:e5:5e:d7:96:47 brd ff:ff:ff:ff:ff:ff
10: vxlan0: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 2a:ae:09:fa:0a:2e brd ff:ff:ff:ff:ff:ff

```

Just verified that vxlan interface creation works as expected.

---

<div class="post-metadata">

### Author: ![flpvsk](https://discourse.vpsfree.cz/user_avatar/discourse.vpsfree.cz/flpvsk/32/107_2.png) [@flpvsk](https://discourse.vpsfree.cz/u/flpvsk)
#### Post date: [February 13, 2025, 10:57am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/6 "2025-02-13T10:57:50Z")

</div>

Totally understand, no worries! I’ll keep digging.

What are you using to run apps on NixOS instead of Docker? I’m not particularly attached to it, just looking for something better than a pile of bash scripts I used to use 🙂

I’m basically looking for a way to have a declarative and ideally isolated stack to run web apps. Each of the apps is the usual combo of a web server, database, cache etc.

---

<div class="post-metadata">

### Author: ![snajpa](https://discourse.vpsfree.cz/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@snajpa](https://discourse.vpsfree.cz/u/snajpa)
#### Post date: [February 13, 2025, 11:04am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/7 "2025-02-13T11:04:50Z")

</div>

can you share your configs with everything sensitive replaced with something non-sensitive? I’ll try to reproduce that vxlan error

we run everything in nixos containers - you can create more containers in vpsAdminOS or you can use LXC/LXD inside, that works too

> **[vpsfree-cz-configuration/cluster/cz.vpsfree/containers at master ·...](https://github.com/vpsfreecz/vpsfree-cz-configuration/tree/master/cluster/cz.vpsfree/containers)**
>
> vpsFree.cz cluster configuration. Contribute to vpsfreecz/vpsfree-cz-configuration development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![snajpa](https://discourse.vpsfree.cz/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@snajpa](https://discourse.vpsfree.cz/u/snajpa)
#### Post date: [February 13, 2025, 11:05am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/8 "2025-02-13T11:05:50Z")

</div>

and this [NixOS Containers - NixOS Wiki](https://nixos.wiki/wiki/NixOS_Containers) uses systemd-nspawn and works well too 🙂

---

<div class="post-metadata">

### Author: ![flpvsk](https://discourse.vpsfree.cz/user_avatar/discourse.vpsfree.cz/flpvsk/32/107_2.png) [@flpvsk](https://discourse.vpsfree.cz/u/flpvsk)
#### Post date: [February 13, 2025, 11:32am UTC](https://discourse.vpsfree.cz/t/nixos-docker-swarm/300/9 "2025-02-13T11:32:02Z")

</div>

> can you share your configs with everything sensitive replaced with something non-sensitive? I’ll try to reproduce that vxlan error

Sure, thanks for looking into it!

Docker compose file & configuration.nix file changes: [NixOS + Docker issue · GitHub](https://gist.github.com/flpvsk/b539e82ece28e96214a8c32a8dacf5c6)

Minimum set of commands I run:

```auto
nixos-rebuild switch
docker swarm init
docker stack deploy -c ./docker-compose.prod.yml gnd_buzz_prod
docker service ps gnd_buzz_prod_web --no-trunc # to see the logs

```

* * *

I’ll check the alternative too, thank you for the pointers!
