[GH-ISSUE #2404] Cannot set listen address for specific network interface for all interfaces #1451

Open
opened 2026-03-02 11:57:26 +03:00 by kerem · 7 comments
Owner

Originally created by @robled on GitHub (Jan 16, 2026).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2404

Describe the Bug

There are some issues listed where it's been suggested that setting the env var HOST or HOSTNAME to 0.0.0.0 will allow the web server to listen on all interfaces. Try as I might, the web server will only listen on the default interface on port 3000.

For my use case with multiple networks this means that I am not able to route my reverse proxy to the Karakeep web server because the proxy network is a private network just for proxy communications and is not the default route. The default route is intended for outbound internet access so that Karakeep can scrape things and whatnot.

If the HOST or HOSTNAME env vars worked for me, it would resolve the problem, but I think that s6 or something is preventing that particular env var from working.

Steps to Reproduce

Set HOST or HOSTNAME to 0.0.0.0. Web server listens only on a single interface.

Expected Behaviour

Set HOST or HOSTNAME to 0.0.0.0. Web server listens on all interfaces.

Screenshots or Additional Context

No response

Device Details

No response

Exact Karakeep Version

0.30.0

Have you checked the troubleshooting guide?

  • I have checked the troubleshooting guide and I haven't found a solution to my problem
Originally created by @robled on GitHub (Jan 16, 2026). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/2404 ### Describe the Bug There are some issues listed where it's been suggested that setting the env var `HOST` or `HOSTNAME` to `0.0.0.0` will allow the web server to listen on all interfaces. Try as I might, the web server will only listen on the *default* interface on port 3000. For my use case with multiple networks this means that I am not able to route my reverse proxy to the Karakeep web server because the proxy network is a private network just for proxy communications and is not the default route. The default route is intended for outbound internet access so that Karakeep can scrape things and whatnot. If the `HOST` or `HOSTNAME` env vars worked for me, it would resolve the problem, but I think that s6 or something is preventing that particular env var from working. ### Steps to Reproduce Set `HOST` or `HOSTNAME` to `0.0.0.0`. Web server listens only on a single interface. ### Expected Behaviour Set `HOST` or `HOSTNAME` to `0.0.0.0`. Web server listens on all interfaces. ### Screenshots or Additional Context _No response_ ### Device Details _No response_ ### Exact Karakeep Version 0.30.0 ### Have you checked the troubleshooting guide? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
Author
Owner

@cat4anna commented on GitHub (Feb 2, 2026):

Hi. I'm having same problem.
Setting HOST variable does not change anything. No idea why it was suggested, it's not listed on configuration page.

To add a bit of context, here is log from karakeep failed to start:

Error: listen EADDRNOTAVAIL: address not available 192.168.4.10:3000
    at <unknown> (Error: listen EADDRNOTAVAIL: address not available 192.168.4.10:3000) {
  code: 'EADDRNOTAVAIL',
  errno: -99,
  syscall: 'listen',
  address: '192.168.4.10',
  port: 3000
}

The 192.168.4.10 is network interface address and karakeep has no access to it.
I'm not going to add network: host to docker-compose just to run karakeep.

<!-- gh-comment-id:3833522339 --> @cat4anna commented on GitHub (Feb 2, 2026): Hi. I'm having same problem. Setting HOST variable does not change anything. No idea why it was suggested, it's not listed on configuration page. To add a bit of context, here is log from karakeep failed to start: ``` ⨯ Failed to start server Error: listen EADDRNOTAVAIL: address not available 192.168.4.10:3000 at <unknown> (Error: listen EADDRNOTAVAIL: address not available 192.168.4.10:3000) { code: 'EADDRNOTAVAIL', errno: -99, syscall: 'listen', address: '192.168.4.10', port: 3000 } ``` The 192.168.4.10 is network interface address and karakeep has no access to it. I'm not going to add `network: host` to docker-compose just to run karakeep.
Author
Owner

@savely-krasovsky commented on GitHub (Feb 21, 2026):

Can confirm, I have the same issue. Though in my case it's pod with two networks:

[Unit]
Description=Karakeep Pod

[Pod]
PodName=karakeep
UserNS=keep-id:uid=1000,gid=1000
Network=karakeep.network
Network=reverse-proxy.network

By default I experienced very strange behavior: Karakeep was randomly returning 502. Then I set docker.provider.network=systemd-reverse-proxy globally, and Karakeep stopped opening at all, returning 502 every time. Then I set docker.provider.network=systemd-karakeep just for Karakeep, and it started to work stably. I then checked which IPs it listens on and confirmed that the reverse-proxy network IP was not being listened to.

<!-- gh-comment-id:3938128783 --> @savely-krasovsky commented on GitHub (Feb 21, 2026): Can confirm, I have the same issue. Though in my case it's pod with two networks: ``` [Unit] Description=Karakeep Pod [Pod] PodName=karakeep UserNS=keep-id:uid=1000,gid=1000 Network=karakeep.network Network=reverse-proxy.network ``` By default I experienced very strange behavior: Karakeep was randomly returning 502. Then I set `docker.provider.network=systemd-reverse-proxy` globally, and Karakeep stopped opening at all, returning 502 every time. Then I set `docker.provider.network=systemd-karakeep` just for Karakeep, and it started to work stably. I then checked which IPs it listens on and confirmed that the `reverse-proxy` network IP was not being listened to.
Author
Owner

@savely-krasovsky commented on GitHub (Feb 21, 2026):

The issue was that s6-overlay sets own HOSTNAME and overrides Dockefile default (0.0.0.0). I fixed it and opened PR.

<!-- gh-comment-id:3938796664 --> @savely-krasovsky commented on GitHub (Feb 21, 2026): The issue was that s6-overlay sets own `HOSTNAME` and overrides Dockefile default (`0.0.0.0`). I fixed it and opened PR.
Author
Owner

@savely-krasovsky commented on GitHub (Feb 24, 2026):

@robled @cat4anna are you using Podman?

<!-- gh-comment-id:3955320910 --> @savely-krasovsky commented on GitHub (Feb 24, 2026): @robled @cat4anna are you using Podman?
Author
Owner

@savely-krasovsky commented on GitHub (Feb 24, 2026):

Temporary patched with this:

Entrypoint=/bin/sh
Exec=-lc 'export HOSTNAME=0.0.0.0; exec /init'

For Docker Compose it should be the same logic.

<!-- gh-comment-id:3955414361 --> @savely-krasovsky commented on GitHub (Feb 24, 2026): Temporary patched with this: ``` Entrypoint=/bin/sh Exec=-lc 'export HOSTNAME=0.0.0.0; exec /init' ``` For Docker Compose it should be the same logic.
Author
Owner

@robled commented on GitHub (Feb 25, 2026):

@robled @cat4anna are you using Podman?

Yes, with multiple networks like your config, which exposes the issue for the listen address + proxy network.

<!-- gh-comment-id:3955439418 --> @robled commented on GitHub (Feb 25, 2026): > [@robled](https://github.com/robled) [@cat4anna](https://github.com/cat4anna) are you using Podman? Yes, with multiple networks like your config, which exposes the issue for the listen address + proxy network.
Author
Owner

@savely-krasovsky commented on GitHub (Feb 25, 2026):

While using HOSTNAME to set listen address is a bad idea in the first place, it seems like it's a Podman issue then. It cannot override HOSTNAME env for some reason. Fix is needed at both Next.js side and probably Podman.

<!-- gh-comment-id:3955448734 --> @savely-krasovsky commented on GitHub (Feb 25, 2026): While using `HOSTNAME` to set listen address is a bad idea in the first place, it seems like it's a Podman issue then. It cannot override `HOSTNAME` env for some reason. Fix is needed at both Next.js side and probably Podman.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1451
No description provided.