Virtualization

Using Wireshark to Capture Docker Traffic on Linux and Docker Desktop

The Back Room Tech Staff · Edited by Aseem Kishore
17 min read

The Back Room Tech is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

Docker Desktop’s Linux VM boundary can hide internal container traffic from a host capture. Native Docker Engine on Linux uses a different capture path. Find that path first, then record one connection for Wireshark. An empty packet list alone tells you little.

Use a Wireshark release supported by your OS and a Docker workload you administer. This workflow covers native Linux bridge networks and Docker Desktop Linux containers on Linux, Windows, and macOS. It adds capture selection and saved-packet analysis to tcpdump and nsenter workflows.

Choose the Interface and Capture Scope for Docker Traffic

1. Prepare a controlled connection and a private capture location

Have these items ready:

  • A running Docker environment and access to its desktop or Linux host.
  • One container connection you can repeat without affecting other users.
  • The destination name, application port, and direction of that connection.
  • A private local folder for the recording.
  • Permission to capture the traffic involved.

Use a harmless application request. Avoid login attempts, production tokens, or private customer data.

For the examples below, 8080 is an example application port. Use it only when your application listens there. Otherwise, use the port visible at your capture point.

Write down the request before recording. Note the client container, destination service, destination port, and expected application response. That gives the capture a clear question to answer.

A local SSD is a practical capture destination. A NAS drive can hold an approved archive, but check its sharing permissions first.

2. Identify the Docker endpoint containing your workload

Run this command in your usual Docker terminal. It works in a Linux shell, macOS Terminal, and Windows PowerShell:

docker context ls

The output lists Docker contexts and their endpoints. Check the active context, then confirm that your target container appears there.

Don’t trust the context name alone. Your Docker CLI can connect to a different computer from the one running Wireshark.

Docker Desktop on Linux creates a desktop-linux context. Native Docker Engine and Docker Desktop keep separate environments. Docker explains this in its Docker Desktop for Linux installation guide.

Choose the capture path from this table:

Connection under investigationCapture location to selectVisibility limit
Native Linux container-to-container bridge trafficThe verified bridge or relevant virtual interface on that Linux hostNamespace-local traffic can remain elsewhere
Native Linux container-to-external trafficThe relevant bridge for the container-side viewA host uplink can show translated addresses
Docker Desktop internal container trafficA recorder within the Linux environment containing that trafficThe ordinary host interface doesn’t expose the internal bridge
Docker Desktop traffic reaching an external serverThe host interface carrying that external connectionInternal container exchanges can remain invisible
A published container portThe side of the forwarding path being investigatedAddresses and ports can differ across the boundary

3. Account for Linux network namespaces before selecting an interface

A network namespace gives a Linux workload its own network view. Its interfaces, routes, and loopback traffic belong to that view.

A host bridge capture can show traffic crossing the bridge. It won’t always show every packet sent inside a container. A DNS exchange handled within the container’s namespace may be absent.

Docker Desktop adds another boundary. Its Linux containers run inside a Linux VM, including on a Linux desktop. The host’s Ethernet adapter and the VM’s internal bridge show different parts of the path.

Before opening capture options, write down the scope you need:

Client-side internal connection, before host forwarding.

Or:

External connection leaving the desktop computer.

That small distinction saves a lot of packet archaeology.

4. Record the versions belonging to this capture

Record the versions shown by the running applications, including their version or About screens:

ComponentRecord
Operating systemDistribution or OS name, release, and build
WiresharkInstalled application version
Docker EngineServer version for the selected endpoint
Docker DesktopDesktop version, when applicable
Capture imagePublisher, repository, tag or digest, and capture-tool version
Capture locationHost interface, bridge, or target namespace

Keep these notes beside the capture file. A Desktop version alone doesn’t identify a separately selected Docker endpoint.

Docker’s release notes list Docker Desktop 4.101.0, dated November 30, 2026, with Docker Engine 29.10.1. Record your installed versions. Don’t copy those numbers into your notes.

Capture on Native Linux Bridge Networks

5. Install Wireshark on Linux and configure capture access

Use the Linux installation guidance linked from the official Wireshark website. Choose the instructions for your distribution and release.

Install the desktop app and its capture component through your distribution’s supported package system. Then follow its capture-permission setup.

Wireshark separates packet recording from the graphical app. On Linux, your distribution’s supported dumpcap permission setup gives the capture component the access it needs.

Warning: Run the Wireshark GUI as your normal user. Don’t launch the entire application through sudo to bypass a capture-permission error.

Launch Wireshark from your desktop’s app launcher. First, confirm that it opens under your normal account.

Linux desktop application launcher showing Wireshark available after installation.

If interface access fails, follow Wireshark’s capture-privilege guidance. Check permissions before changing Docker networking.

6. Match the container’s network to a host interface

Check the target container’s network attachment in your Docker management interface. Record the network name and the container’s address on that network.

Next, check the Linux host’s network-interface details. Match the Docker network to the host bridge or virtual interface it uses.

Don’t select an interface because its name resembles an online example. Check both docker0 and generated bridge names before trusting either.

Open Wireshark and choose Capture > Options. Find the interface you matched to the target Docker network.

Expected result: the selected interface matches the network carrying your test connection. If you can’t prove that match, resolve the scope before recording.

Capture Options showing a host interface matched to the target Docker bridge network, with the interface name and capture-filter field visible.

If the expected interface is absent, repeat the endpoint check:

docker context ls

A Desktop workload or remote endpoint explains why its internal interface is absent from the local Linux host.

7. Set both recording bounds before starting

In Capture > Options, check your release’s capture-output and automatic-stop settings. Use the Wireshark User’s Guide for that release’s control labels and units.

For this small test recording, set practical stop bounds for your environment:

SettingRecommended approachPurpose
DurationA short time window long enough to repeat one requestStops recording automatically after your test
File sizeA modest file-size cap suited to your available disk spaceCaps the recording’s storage use
OutputOne file in your private capture folderKeeps export and cleanup straightforward

Wireshark does not impose universal default stop limits, and control labels and units vary by installed version. Check the units shown in your version’s Capture > Options dialog before starting.

Use settings that stop recording when a bound is reached. A rotating ring buffer keeps data differently. Check its setup before using rotation to cap total storage.

Before clicking Start, confirm that both bounds are enabled. If your version has different controls, check its guide before proceeding.

Installed Wireshark capture settings showing a 30-second stop limit and a 10 MB file-size stop limit, with the displayed units visible.

8. Capture one request on the verified bridge

For the first test recording, leave the capture filter empty unless the bridge carries unrelated sensitive traffic. A port-only filter can remove DNS evidence you later need.

Click Start, then repeat your chosen request once.

Return to Wireshark and choose Capture > Stop, or let the configured bound stop recording. Confirm that capture has stopped before reviewing packets.

Expected result: packets from the test connection appear at the selected capture point. The count depends on the request, protocol, and other traffic.

If no relevant packets appear, check these items in order:

  • Confirm the request ran during the recording.
  • Confirm the selected Docker endpoint contains the client.
  • Recheck the interface-to-network match.
  • Check whether a capture filter excluded the observed port.
  • Consider whether the exchange stayed inside a namespace.

Don’t change firewall rules based on an empty capture alone.

Docker Desktop VM Boundary and Capture Methods

Docker Desktop’s host and Linux-container network views need separate checks. A host recording can help you inspect external traffic. To inspect internal container traffic, place the recorder where those packets exist.

The platform steps below prepare local Wireshark analysis. The VM’s bridge remains inside the VM.

9. Linux: distinguish Desktop from native Engine

Install local Wireshark using the Linux procedure above. Then run:

docker context ls

Confirm that your target belongs to Docker Desktop before choosing the Desktop capture path.

Docker Desktop for Linux requires virtualization support, KVM, QEMU 5.2 or later, systemd, and at least 4 GB RAM. These requirements apply to Desktop. Native Docker Engine has separate requirements. Follow Docker’s Linux installation documentation for your distribution’s setup.

In Docker Desktop, find the target workload and record its network attachment. In local Wireshark, inspect Capture > Options.

Expected result: you can tell the host’s available interfaces apart from the workload’s internal network. Don’t expect the two lists to match.

For external traffic, select the verified host interface and apply the same recording bounds. For internal traffic, use the saved-recording path in Step 12.

10. Windows: install the local analyzer for Linux-container captures

Open the official Wireshark website and select its Windows download. Follow the installer guidance for your Windows release.

Set up capture access using Wireshark’s platform guidance if you need live host recording. Opening a saved capture is separate from capturing a Windows interface.

Launch Wireshark from Windows. Then open Docker Desktop and confirm that the target workload uses Linux containers.

Windows Start search showing the installed Wireshark application ready to launch.

In PowerShell, inspect the Docker contexts:

docker context ls

Confirm the workload’s endpoint before recording.

A Windows host capture may observe traffic crossing the Windows network stack, but it does not generally expose all internal traffic running inside Docker Desktop’s Linux VM. To inspect internal Linux-container exchanges, follow Step 12 to capture inside the relevant Linux environment and open the saved file locally.

11. macOS: install the local analyzer and retain the VM distinction

Open the official Wireshark website and choose the macOS download for your Mac.

Follow the package’s installation guidance. Set up host-capture access through Wireshark’s capture-privilege instructions when you need live host recording.

Launch Wireshark from macOS.

macOS Applications showing the installed Wireshark application.

In Terminal, inspect the Docker contexts:

docker context ls

Confirm that your target workload belongs to Docker Desktop.

Because Docker Desktop runs Linux containers inside an isolated Linux VM, the VM’s internal bridge is not ordinarily exposed as a macOS host interface. A macOS host capture can inspect an external connection leaving the Mac, while internal container traffic must be recorded inside the relevant Linux environment and exported for local analysis.

Switching from Wi-Fi to a wired connection can change the active macOS host interface. A USB Ethernet adapter helps keep external host captures stable, but it still cannot expose the Linux VM’s internal bridge.

12. Preserve an internal Desktop recording before removing its recorder

For Docker Desktop Linux containers on Linux, Windows, and macOS, the most direct lab path is a temporary sidecar container attached to the target container’s network namespace. Docker documents this namespace-sharing mode (--network container:<target>) in the Docker CLI docker run reference.

This procedure applies only to running Linux containers in an environment where local security policy permits --network container: and the NET_RAW and NET_ADMIN capabilities. It does not apply to Windows containers.

First, confirm the running target container’s name in your active Docker Desktop context. Run this in your Linux shell, macOS Terminal, or Windows PowerShell:

docker ps

Next, list the interfaces visible inside that container’s network namespace using a vetted Linux capture image. The examples below use the community nicolaka/netshoot image, which bundles Wireshark’s dumpcap utility; pin a specific tag or digest, or substitute an image approved by your security team:

docker run --rm --network container:TARGET_CONTAINER --cap-add=NET_RAW --cap-add=NET_ADMIN nicolaka/netshoot dumpcap -D

Replace TARGET_CONTAINER with your container’s name or ID, and record the exact image digest and dumpcap --version output in your Step 4 notes. In a typical Linux container namespace, eth0 carries bridge traffic and lo carries loopback traffic.

Start a bounded recording on the verified interface without --rm, so the file remains available until you export and verify it. Per the Wireshark dumpcap manual, -a duration:30 stops after 30 seconds and -a filesize:10240 stops at 10,240 KiB (10 MiB):

docker run --name pkt-capture --network container:TARGET_CONTAINER --cap-add=NET_RAW --cap-add=NET_ADMIN nicolaka/netshoot dumpcap -i eth0 -a duration:30 -a filesize:10240 -w /tmp/capture.pcapng

While dumpcap is running, trigger your controlled test request once. Wait for the capture to stop automatically, or press Ctrl+C after the request completes.

Copy the recording from the stopped container into your private local capture folder with docker cp, as documented in the Docker CLI docker cp reference. Using docker cp avoids OS-specific bind-mount path differences across Linux, macOS, and Windows:

docker cp pkt-capture:/tmp/capture.pcapng ./capture.pcapng

Open ./capture.pcapng in local desktop Wireshark before removing the recorder. Confirm that it contains packets from your target connection; a filename inside a container doesn’t prove that export worked.

Once the local file opens cleanly, delete the stopped recorder container:

docker rm pkt-capture

If your approved internal image includes tcpdump instead of dumpcap, use the same --network container:TARGET_CONTAINER and docker cp pattern with a bounded command such as timeout 30 tcpdump -i eth0 -c 5000 -w /tmp/capture.pcap.

If local policy or your backend blocks --network container: or capture capabilities, you cannot record another container’s namespace from a sidecar. In that case, capture boundary-crossing traffic on the verified host interface (Steps 9–11), or reproduce the workload on native Linux Docker Engine (Steps 5–8) to capture on the host bridge directly.

If you prefer a browser-based capture interface, the LinuxServer.io Wireshark image is a documented third-party GUI container. Running a containerized GUI alone still requires compatible network-namespace access and capture privileges to see another container’s packets.

Expected result: ./capture.pcapng opens in local desktop Wireshark and contains packets from your target connection, and the temporary pkt-capture container is removed only after verification.

Open the Capture in Wireshark and Separate DNS, TCP, and Application Failures

13. Open the saved file and verify its scope

Open the saved recording in Wireshark. Check its time range against your request notes.

Find packets whose addresses and ports match the selected capture point. A container-side capture can show a different destination port from a host-side published connection.

If your application uses TCP port 8080 at this point, enter this display filter:

tcp.port == 8080

Apply it. The packet list should show matching TCP packets, if the recording contains them.

This filter changes the visible packet list. It leaves the other packets in the saved capture.

A saved Docker capture with tcp.port == 8080 applied and a relevant packet selected, showing the actual addresses and TCP details.

14. Inspect DNS evidence before blaming the connection

Clear the port display filter before checking name resolution. A TCP port filter hides DNS traffic outside that port.

Find the name lookup for your request, if the capture point includes it. Select the request and response packets, then expand their DNS details.

Check:

  • Does the query contain the expected name?
  • Is a response visible?
  • Does the response contain the expected address or an error?
  • Does the application then connect to that address?

A visible DNS error gives you evidence to follow. An absent DNS exchange needs more care.

The application may have reused an earlier answer. The lookup may also have happened outside the capture’s scope. Absence alone can’t tell you whether resolution worked.

Use the packet-detail workflow in the Wireshark User’s Guide to inspect the recorded fields.

15. Inspect TCP progress before changing application settings

Return to the application-port filter. Select the first visible TCP packet for the attempted connection.

Expand its TCP details and inspect the flags. Follow packets with the same endpoint pair through the list.

Observed patternDiagnostic implication
Connection initiation followed by a reply and acknowledgmentTCP establishment is visible
Repeated connection attempts without a visible replyInvestigate the destination and return path
An immediate resetThe connection was actively rejected or reset
An established connection followed by dataContinue into application analysis

A one-sided capture limits what you can conclude. Missing replies can reflect the capture point rather than the destination’s behavior.

Record what you see precisely. “No reply appears in this bridge capture” is stronger evidence than “the firewall is broken.”

16. Inspect the application response within encryption limits

For readable application traffic, select the response packet and expand the protocol details.

Check whether the server returned an error, closed the connection, or supplied the expected response. A successful TCP exchange followed by an application error points above the transport layer.

For encrypted TLS traffic, inspect the visible handshake and connection behavior. Application payloads stay encrypted without an established decryption setup.

An unreadable HTTPS response doesn’t prove that the server returned nothing.

An exported Docker Desktop Linux-container capture opened locally, with a relevant packet selected and its visible protocol details expanded.

Capture Filters Versus Display Filters

17. Choose the filter according to when it takes effect

A capture filter restricts packets before recording. You can’t recover excluded packets from that file.

A display filter restricts what Wireshark shows afterward. The original packets remain available.

GoalCapture filterDisplay filter
Match TCP traffic using port 8080tcp port 8080tcp.port == 8080

These expressions use different languages. The Wireshark manual explains their separate roles.

I’d use a display filter first on a small, controlled network. It preserves context. On a busy shared network, a capture filter can reduce unrelated payload collection.

18. Repeat a narrow recording only after confirming the port

Return to Capture > Options. Enter this capture filter only if 8080 matches the port at that interface:

tcp port 8080

Keep both recording bounds enabled. Start capture, repeat the request once, then stop.

Open the new file and apply:

tcp.port == 8080

Compare the results with the broader recording. Expect the narrow file to omit traffic outside the capture filter. That includes relevant DNS exchanges on other ports.

Comparison showing tcp port 8080 in Capture Options and tcp.port == 8080 in the saved capture's display-filter field.

Least Privilege, Sensitive Payload Handling, and Cleanup

19. Fix capture permissions at the recording component

If Wireshark opens but can’t capture, check platform capture permissions first.

On Linux, repair the distribution-supported dumpcap setup. For a container recorder, check its documented capability requirements and namespace access.

Wireshark’s capture-privilege guidance covers capture access, including container capabilities such as NET_RAW and NET_ADMIN.

Diagnose the access failure before granting unrestricted privileged mode. If policy blocks namespace access, use an approved recording location.

20. Resolve misleading packets before changing the network

If packets appear to have bad checksums or unusual sizes, consider host offload behavior and capture location.

Compare the symptom with the actual application result. Check whether it appears at another approved capture point before changing interface settings.

If published-port traffic has unexpected addresses, check which side of the forwarding boundary you recorded. Match filters to observed packets rather than the port the client first used.

These checks have less impact than restarting services or changing firewall rules.

21. Preserve evidence, then remove temporary resources

Open the exported recording one final time. Confirm that it contains the relevant time window and packets.

Record the endpoint, capture location, versions, request, and filters beside it. Then remove temporary capture resources through the management interface you used to create them.

Warning: Deleting a recorder or temporary volume can destroy its only capture copy. Verify the local file first.

Keep captures in a folder with restricted access. Payloads can contain private data even when the test itself looked harmless.

If retention isn’t required, delete the recording through your OS file manager and clear its deleted-items location. For sensitive storage, follow your organization’s encrypted-storage and media-sanitization policy. Ordinary deletion doesn’t guarantee physical erasure.

Wrapping Up

Choose the capture point before drawing conclusions from missing packets. I’d keep the first recording small but broad enough to preserve context. Narrow it once you’ve proved the packet path.

StepActionApplies To
1Confirm endpoint and network scopeAll platforms
2Select the verified bridgeNative Linux Engine
3Export an internal recording for local analysisDocker Desktop
4Inspect DNS, TCP, then application evidenceAll saved captures

After a reconnect, reboot, or Docker Desktop update, recheck the endpoint and interface mapping. Repeat the same test request and confirm that the expected conversation is still visible.

Sources