You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using node 18 on OS X Ventura 13.1, and the pg client resolves localhost to ::1 which Colima cannot handle. The connection fails. If I use 127.0.0.1, it works. I believe this is because node 18 does enforce IPv4 resolution first anymore, and Colima cannot handle a IPv6 address. But Docker Desktop handles it just fine. Any chances of getting this addressed?
Thanks!
Version
Colima Version: 0.5.2
Lima Version:
Qemu Version:
Operating System
macOS Intel <= 12 (Monterrey)
macOS Intel >= 13 (Ventura)
macOS M1 <= 12 (Monterrey)
macOS M1 >= 13 (Ventura)
Linux
Output of colima status
No response
Reproduction Steps
Fire up Postgres container.
Run node 18 code to connect to it via localhost. It will resolve to ::1 (IPv6)
Connection failure
Expected behaviour
Should connect.
Additional context
Docker Desktop works.
Reacted by Sander Maijers, sergeybe2, Fabian Frank, Raphael Schweikert, Eli, Bruno Gomes, Sam Rowe, Carlos Frias, Carlos Silva, Cristian Greco and 31 more
You can work around this by commenting out ::1 localhost in /etc/hosts. Not the best solution, but better than nothing..
SEO: We had this problem when using testcontainers-node. Error: Failed to connect to Reaper and Error: No Docker client strategy found wasn't straight forward to debug. Setting TESTCONTAINERS_HOST_OVERRIDE=127.0.0.1 also works.
Not quite sure if thats exactly related, but I had the same problem while connecting a local node application to a (locally running) docker container. What helped in my case was to specify the socket option when creating the Redis client:
You can work around this by commenting out ::1 localhost in /etc/hosts. Not the best solution, but better than nothing..
This did not work for me. I suspect the resolution of localhost is done by some clients without going through the hosts file.
What did work was manually changing all connection strings to reference 127.0.0.1 instead of localhost.
I agree, though, that the real fix would be for colima to additionally bind to [::1] whenever it binds to 127.0.0.1 implicitly (same goes for [::] when the implicit binding is to 0.0.0.0).
Reacted by Eli, Mike Lamsma, cellulosa, Matthew Read, CSKim and Luis Davim
I'm using colima to run a VPN alongside a socks5 server, and it looks like I need to remove IPv6 addresses and routes from my config files.
docker run -v (pwd)/<wg config with v6>.conf:/etc/wireguard/vpn.conf --cap-add=NET_ADMIN --rm local/wgd:latest
[#] ip link add vpn type wireguard
[#] wg setconf vpn /dev/fd/63
[#] ip -4 address add 10.66.140.107/32 dev vpn
[#] ip -6 address add fc00:bbbb:bbbb:bb01::3:8c6a/128 dev vpn
RTNETLINK answers: Permission denied
[#] ip link delete dev vpn
Reacted by Tymur Kubai, Etienne Maheu, LACHAUD Jérémy, Matthew Read, maltewirz, Or-Zarchi-Forter, Robert Holden, Andrzej Pomirski, CSKim, Nathan Cho and 3 more
I encountered the same issue and it took some time to identify the cause. Since Docker Desktop supports this out of the box, perhaps we could add a note in the documentation to clarify it for others?
Still reproducible on Colima 0.10.1 on macOS. Adding a more concrete diagnosis in case it helps.
The Lima config generated by Colima (~/.colima/_lima/colima/lima.yaml) only declares IPv4 port forwards : 0.0.0.0 and 127.0.0.1, no :: or ::1. On macOS, /etc/hosts maps localhost to both 127.0.0.1 and ::1, and per RFC 6724 the resolver returns IPv6 first. So any client connecting to the first resolved address gets connection refused. Docker Desktop doesn't have this issue because it publishes on both loopbacks.
Not specific to Node.js / Postgres, I hit it from Rust (std::net::ToSocketAddrs) running integration tests against a containerized Hive Metastore.
Reacted by Fredrik A. Madsen-Malmo and Veeti Haapsamo
Activity
henrik242 commentedon Jan 30, 2023
You can work around this by commenting out
::1 localhostin /etc/hosts. Not the best solution, but better than nothing..SEO: We had this problem when using testcontainers-node.
Error: Failed to connect to ReaperandError: No Docker client strategy foundwasn't straight forward to debug. SettingTESTCONTAINERS_HOST_OVERRIDE=127.0.0.1also works.henrik242 commentedon Jan 30, 2023
Maybe related: lima-vm/lima#1330
shlomioz commentedon Feb 12, 2023
Same issue for me.
mxngls commentedon Feb 24, 2023
Not quite sure if thats exactly related, but I had the same problem while connecting a local node application to a (locally running) docker container. What helped in my case was to specify the socket option when creating the Redis client:
When using Docker Desktop this setup was not necessary.
sabberworm commentedon Mar 9, 2023
This did not work for me. I suspect the resolution of
localhostis done by some clients without going through the hosts file.What did work was manually changing all connection strings to reference
127.0.0.1instead oflocalhost.I agree, though, that the real fix would be for colima to additionally bind to
[::1]whenever it binds to127.0.0.1implicitly (same goes for[::]when the implicit binding is to0.0.0.0).acuteaura commentedon Mar 20, 2023
I'm using colima to run a VPN alongside a socks5 server, and it looks like I need to remove IPv6 addresses and routes from my config files.
abiosoft commentedon Mar 20, 2023
Yeah it is. Ipv6 is not properly supported in Lima yet.
genki commentedon Mar 23, 2023
Facing similar issue.
Is there a way to disable IPv6 and use only IPv4?
use 127.0.0.1 in with-test-db.sh for colima
use 127.0.0.1 in with-test-db.sh for colima (#1297)
use 127.0.0.1 in with-test-db.sh for colima (#1297)
Appview - serve feed skeletons (#1265)
use 127.0.0.1 in with-test-db.sh for colima (#1297)
Appview - serve feed skeletons (#1265)
Refactor appview media embeds (#1343)
earcherc commentedon Aug 28, 2023
bump
use 127.0.0.1 in with-test-db.sh for colima (bluesky-social#1297)
Appview - serve feed skeletons (bluesky-social#1265)
Refactor appview media embeds (bluesky-social#1343)
use 127.0.0.1 in with-test-db.sh for colima (bluesky-social#1297)
Appview - serve feed skeletons (bluesky-social#1265)
Refactor appview media embeds (bluesky-social#1343)
Appview - serve feed skeletons (#1265)
f-moya commentedon Jul 30, 2025
I encountered the same issue and it took some time to identify the cause. Since Docker Desktop supports this out of the box, perhaps we could add a note in the documentation to clarify it for others?
toutane commentedon May 5, 2026
Still reproducible on Colima 0.10.1 on macOS. Adding a more concrete diagnosis in case it helps.
The Lima config generated by Colima (
~/.colima/_lima/colima/lima.yaml) only declares IPv4 port forwards :0.0.0.0and127.0.0.1, no::or::1. On macOS,/etc/hostsmapslocalhostto both127.0.0.1and::1, and per RFC 6724 the resolver returns IPv6 first. So any client connecting to the first resolved address gets connection refused. Docker Desktop doesn't have this issue because it publishes on both loopbacks.Not specific to Node.js / Postgres, I hit it from Rust (
std::net::ToSocketAddrs) running integration tests against a containerized Hive Metastore.