Getting RocketChat to listen to IPv6 as well as IPv4

Description

Server Setup Information

  • Version of Rocket.Chat Server: 4.2.2
  • Operating System: Ubuntu 20.04
  • Deployment Method: snap
  • Number of Running Instances: 1
  • DB Replicaset Oplog:
  • NodeJS Version:
  • MongoDB Version: 3.6
  • Proxy: caddy

RocketChat, installed by snap, is currently only listening on IPv4 interfaces. I want it to listen to BOTH IPv4 AND IPv6 interfaces. From there on I can edit Caddy to forward IPv6 as well, but currently RocketChat isn’t even listening on IPv6. How do I change this and enable IPv6 connectivity?

root@rocketchat:~# ss -tulpn
Netid    State     Recv-Q     Send-Q         Local Address:Port          Peer Address:Port    Process
udp      UNCONN    0          0              127.0.0.53%lo:53                 0.0.0.0:*        users:(("systemd-resolve",pid=119,fd=12))
tcp      LISTEN    0          128                127.0.0.1:27017              0.0.0.0:*        users:(("mongod",pid=7993,fd=11))
tcp      LISTEN    0          4096           127.0.0.53%lo:53                 0.0.0.0:*        users:(("systemd-resolve",pid=119,fd=13))
tcp      LISTEN    0          128                  0.0.0.0:22                 0.0.0.0:*        users:(("sshd",pid=202,fd=3))
tcp      LISTEN    0          511                  0.0.0.0:3000               0.0.0.0:*        users:(("node",pid=8287,fd=46))
tcp      LISTEN    0          100                127.0.0.1:25                 0.0.0.0:*        users:(("master",pid=358,fd=13))
tcp      LISTEN    0          128                127.0.0.1:6010               0.0.0.0:*        users:(("sshd",pid=15302,fd=10))
tcp      LISTEN    0          128                     [::]:22                    [::]:*        users:(("sshd",pid=202,fd=4))
tcp      LISTEN    0          100                    [::1]:25                    [::]:*        users:(("master",pid=358,fd=14))
tcp      LISTEN    0          128                    [::1]:6010                  [::]:*        users:(("sshd",pid=15302,fd=9))

Bumping this up for visibility.

Anybody from the RocketChat dev team that can explain how to have Rocketchat listen on IPv6?

Hi @arin - set the BIND_IP environment variable to ::.

Thanks for your reply - is this an environment variable inside the container / OS that rocket chat is hosted on, or is this in a particular file / specific location for RocketChat on snap installs?

Can I set the BIND_IP to listen to both :: as well as 0.0.0.0/0?

Just setting to :: will take care of both.

It’s an environment variable. Check this.

1 Like

Thanks @debdut.chakraborty, that fixed it!