[Bug]: Audiobookshelf only listens on IPv4 interface #804

Closed
opened 2026-04-24 23:22:11 +02:00 by adam · 3 comments
Owner

Originally created by @imcdona on GitHub (Dec 7, 2022).

Describe the issue

The optional hostname parameter passed to the server.listen() method resolves to 0.0.0.0 making the server inaccessible via IPv6. Removing the optional hostname (this.Host) parameter from server.listen() results in the server listening on both IPv6 and IPv4 addresses,

Steps to reproduce the issue

  1. Start an Audiobookshelf container with an IPv6 address assigned.
    docker run -d --network=ipvlan0 --ip6 2001:db8:1::171 --ip 10.30.90.171 --name audiobookshelf ghcr.io/advplyr/audiobookshelf:latest

  2. Not that you are unable to access the application at it's assigned IPv6 address: http://[2001:db8:1::171]

  3. Remove the optional hostname parameter from server/Server.js and rebuild the Docker image.
    change this:
    this.server.listen(this.Port, this.Host, () => {
    to this:
    this.server.listen(this.Port, () => {

  4. Run newly built container

docker run -d --network=ipvlan0 --ip6 2001:db8:1::171 --ip 10.30.90.171 --name audiobookshelf audiobookshelf:ipv6

  1. Note that you are able to access the application at http://[2001:db8:1::171] and at it's corresponding IPv4 address.

The above instructions assume you've already created a dual-stack ipvlan docker network and that your computer is capable of reaching that network via IPv6/IPv4, If not, a summary of the steps required are below:

Add the following to /etc/docker/daemon.json and restart the Docker daemon

{
  "ipv6": true,
  "fixed-cidr-v6": "2001:db8:2::/64"
}

Add an IPv6 enabled ipvlan network named ipvlan0:

docker network  create  -d ipvlan --ipv6 \
   --subnet=10.30.90.0/24 \
   --gateway=10.30.90.1 \
     --subnet=2001:db8:1::/64 \
     --gateway=2001:db8:1::/64 \
     -o ipvlan_mode=l2 \
    -o parent=eth0 ipvlan0

Assign your computer an IPv6 address. ex 2001:db8:1::44

Audiobookshelf version

v2.2.7

How are you running audiobookshelf?

Docker

Originally created by @imcdona on GitHub (Dec 7, 2022). ### Describe the issue The optional _hostname_ parameter passed to the [server.listen()](https://www.w3schools.com/nodejs/met_server_listen.asp) method resolves to _0.0.0.0_ making the server inaccessible via IPv6. Removing the [optional](https://www.w3schools.com/nodejs/met_server_listen.asp) _hostname_ (this.Host) parameter from `server.listen()` results in the server listening on both IPv6 and IPv4 addresses, ### Steps to reproduce the issue 1. Start an Audiobookshelf container with an IPv6 address assigned. `docker run -d --network=ipvlan0 --ip6 2001:db8:1::171 --ip 10.30.90.171 --name audiobookshelf ghcr.io/advplyr/audiobookshelf:latest` 2. Not that you are unable to access the application at it's assigned IPv6 address: _http://[2001:db8:1::171]_ 4. Remove the optional _hostname_ parameter from _server/Server.js_ and rebuild the Docker image. change this: `this.server.listen(this.Port, this.Host, () => {` to this: `this.server.listen(this.Port, () => {` 5. Run newly built container `docker run -d --network=ipvlan0 --ip6 2001:db8:1::171 --ip 10.30.90.171 --name audiobookshelf audiobookshelf:ipv6` 6. Note that you are able to access the application at _http://[2001:db8:1::171]_ and at it's corresponding IPv4 address. The above instructions assume you've already created a dual-stack ipvlan docker network and that your computer is capable of reaching that network via IPv6/IPv4, If not, a summary of the steps required are below: **Add the following to /etc/docker/daemon.json and restart the Docker daemon** ``` { "ipv6": true, "fixed-cidr-v6": "2001:db8:2::/64" } ``` **Add an IPv6 enabled ipvlan network named _ipvlan0_:** ``` docker network create -d ipvlan --ipv6 \ --subnet=10.30.90.0/24 \ --gateway=10.30.90.1 \ --subnet=2001:db8:1::/64 \ --gateway=2001:db8:1::/64 \ -o ipvlan_mode=l2 \ -o parent=eth0 ipvlan0 ``` Assign your computer an IPv6 address. ex 2001:db8:1::44 ### Audiobookshelf version v2.2.7 ### How are you running audiobookshelf? Docker
adam added the bug label 2026-04-24 23:22:11 +02:00
adam closed this issue 2026-04-24 23:22:12 +02:00
Author
Owner

@advplyr commented on GitHub (Dec 7, 2022):

Have you checked that the mobile app is able to connect using the IPv6 address?

@advplyr commented on GitHub (Dec 7, 2022): Have you checked that the mobile app is able to connect using the IPv6 address?
Author
Owner

@imcdona commented on GitHub (Dec 7, 2022):

Yes it does. I'm able to add a server using the http://[ipv6.address] syntax as well as using a hostname with an IPv6 AAAA record and it works as expected.

@imcdona commented on GitHub (Dec 7, 2022): Yes it does. I'm able to add a server using the http://[ipv6.address] syntax as well as using a hostname with an IPv6 AAAA record and it works as expected.
Author
Owner

@advplyr commented on GitHub (Dec 18, 2022):

Fixed in v2.2.9

@advplyr commented on GitHub (Dec 18, 2022): Fixed in [v2.2.9](https://github.com/advplyr/audiobookshelf/releases/tag/v2.2.9)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#804