Launch offer: -50% for your first 3 months with code LANCEMENT — new customers, VPS, first 50 orders, until 31 Dec 2026. See the VPS plans →
FranceHosta RootLab service
Please note: ordering, the customer area and our terms are currently available in French only.
Practical guide

Docker on an IPv6-only VPS

By default, Docker only gives its containers IPv4. On a server without IPv4, they end up cut off from the Internet. Three settings are enough for your containers to download, update and respond over IPv6.

Before you start: KVM, not LXC

Docker needs Linux kernel features that are restricted inside an LXC container. Choose a KVM VPS, which has its own kernel (see KVM or LXC). The VPS Mini is enough for one or two small containers; from three or four services, or with a database, take the VPS Start or the VPS Plus.

What breaks without configuration

Two things cause problems on an IPv6-only VPS:

  • Downloads. Some services have no IPv6, such as Docker's installation repository or the ghcr.io registry. Docker Hub, on the other hand, offers an IPv6 endpoint.
  • The containers themselves. Docker's default network only has IPv4. A container that wants to reach an API, send an email or download an update finds no route.

Start by setting up a NAT64/DNS64 service on the VPS, as explained in the GitHub over IPv6 guide. It solves the first point, and will also benefit the containers, which inherit the machine's DNS servers.

1. Install Docker

Once NAT64 is in place, Docker's official script works. Read it before running it, like any downloaded script:

curl -fsSL https://get.docker.com -o get-docker.sh
less get-docker.sh
sh get-docker.sh
docker --version
docker compose version

2. Enable IPv6 in Docker

Create or edit the file /etc/docker/daemon.json:

{
  "ipv6": true,
  "fixed-cidr-v6": "fd00:d0c:1::/64"
}

fd00:d0c:1::/64 is a private IPv6 network (a ULA address, the equivalent of IPv4's 192.168.x.x). Your containers get an address in it, and Docker translates their outgoing traffic to the VPS's public address, exactly as it does with IPv4. This is necessary because your VPS only has a single public IPv6 address (/128): it is impossible to give one to each container. Restart Docker:

systemctl restart docker

3. Check from a container

docker run --rm alpine ping -6 -c 3 ipv6.google.com
docker run --rm alpine wget -qO- https://api64.ipify.org

The first command should receive replies, the second should print your VPS's IPv6 address: the container is reaching the Internet through your address. If the alpine image does not download, check NAT64, or use Docker Hub's IPv6 endpoint directly:

docker pull registry.ipv6.docker.com/library/alpine:latest

4. Docker Compose: enable IPv6 on each network

The daemon.json setting only applies to the default network. Compose creates one network per project, which stays IPv4-only unless you say otherwise. Add a network with enable_ipv6:

services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
    networks:
      - app

networks:
  app:
    enable_ipv6: true

If no subnet is specified, Docker picks a private IPv6 network in fd… by itself. Start with docker compose up -d.

5. Publish a port over IPv6

A port published with -p 8080:80 or in the ports section listens on all of the machine's addresses, IPv6 included. Test from your computer:

curl -6 http://[2001:db8::10]:8080

Replace the address with your VPS's. For a site to also be visible to visitors on IPv4, put it behind Cloudflare as explained in the IPv6 VPS guide.

Firewall: Docker adds its own rules for published ports, IPv6 included. A published port is therefore open to the whole world, even if your firewall blocks it elsewhere. For a service meant for the machine only, publish it on the local address: "[::1]:8080:80".

Frequently asked questions

Does Docker work on an LXC VPS?

Not reliably: Docker needs kernel features that are restricted inside an LXC container. Choose a KVM VPS. See KVM or LXC.

Can each container have its own public IPv6 address?

No: each VPS gets a single public IPv6 address (/128). Containers use private addresses and Docker translates their traffic to the VPS's address. To expose several web services, put a reverse proxy such as Caddy or Nginx in front of them.

My container has no Internet access, what should I check?

Three things, in order: that the VPS itself reaches the site you want (getent ahostsv6 site-name), that IPv6 is enabled in /etc/docker/daemon.json and on the Compose network (enable_ipv6: true), and that NAT64 is configured if the site has no IPv6.

Can I use images from ghcr.io?

Yes, with a NAT64/DNS64 service: ghcr.io is only reachable over IPv4. The setup is explained in the GitHub over IPv6 guide.

A KVM VPS for your containers

Root access, SSD, DDR3 ECC RAM, dedicated IPv6, hosted in France from €1.49 a month.