Tutorials · DevOps & Containers

How to Secure Docker Containers on Edge Servers

Edge servers sit on customer sites, often unattended. Harden the host and every container: least privilege, pinned images, no exposed Docker API and regular patching.

Intermediate12 min6 steps

Before you start

  • A Docker host such as a NavEdge edge server
  • Your compose files

Step by step

  1. Never expose the Docker API

    The Docker socket and TCP port 2375 give full root access to the host. Do not publish them, and do not mount /var/run/docker.sock into application containers.

  2. Run as non-root

    Set a user in the image or the compose file, drop all Linux capabilities and add back only what the app needs.

    services:
      app:
        user: "1000:1000"
        read_only: true
        tmpfs: [/tmp]
        cap_drop: [ALL]
        security_opt: ["no-new-privileges:true"]
    
  3. Publish only what is needed

    Bind admin ports to localhost or the management VLAN instead of all interfaces.

    ports:
      - "127.0.0.1:9000:9000"   # admin UI, reach it through an SSH tunnel
      - "8080:8080"             # the service users need
    
  4. Pin and scan images

    Use exact version tags or digests from trusted registries, and scan them for known vulnerabilities before rollout.

    docker image inspect --format '{{index .RepoDigests 0}}' nginx:1.27-alpine
    
  5. Limit resources

    Stop one container from starving the rest of the edge server.

    deploy:
      resources:
        limits: { cpus: "1.0", memory: 512M }
    
  6. Patch on a schedule

    Update the host OS, Docker Engine and images monthly, and immediately for critical vulnerabilities. Test on one site first.

Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.

Pro tips

  • Firewall the edge server: allow only the ports in your compose files plus SSH from the management VLAN.
  • Back up named volumes, not containers.