Skip to main content

Docker on VPS behind NAT

If your node is running inside a Docker container on a VPS and connections fail, your container network setup may be the issue

A
Written by Adine
Updated today

When this applies

This applies if:

  1. You are using Docker

  2. Your node is hosted on a VPS

  3. Your node shows Strict / Symmetric NAT or Monitoring failed

Problem

By default, Docker uses a bridge network, which adds another layer of NAT.

This can:

  1. Prevent incoming connections

  2. Cause NAT issues

  3. Result in failed sessions

Solution: use host network mode

Run your container with:

--network=host

This allows the container to:

  1. Use the host’s network directly

  2. Avoid additional NAT layers

  3. Improve connectivity


Important

  1. Host networking works only on Linux

  2. Not supported on:

    1. Docker Desktop (macOS)

    2. Docker Desktop (Windows)

Did this answer your question?