Ubuntu and Docker - How to Check Used and Available Ports With Netstat


Docker containers which are using the network of the host (the machine Docker runs on) will also need to share the ports of the host with each other.

So when creating a new container you will first have to make a choice whether:

  1. You want to use a macvlan network with its own IP address
  2. Or you want to use the ports of the host

Netstat

I run the following on the CLI of my Ubuntu VM. After running, check in the list whether a port is in use or not:

sudo netstat -tulpen

Net Tools may still need to be installed:

sudo apt-get update
sudo apt install net-tools

Read other notes

Comments

    No comments found for this note.

    Join the discussion for this note on this ticket. Comments appear on this page instantly.

    Tags


    Notes mentioning this note

    • Docker - QuestDB Container Setup
      QuestDB is a high-performance, open-source SQL database. QuestDB’s stack is engineered from scratch, zero-GC Java and dependency-free. It includes endpoints...

    Notes Graph