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.
Before you start
- A Docker host such as a NavEdge edge server
- Your compose files
Step by step
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.
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"]
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
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-alpineLimit resources
Stop one container from starving the rest of the edge server.
deploy: resources: limits: { cpus: "1.0", memory: 512M }
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.
FAQ
Frequently asked questions
Is a container a security boundary?
Only partly: containers share the host kernel. Treat a compromised container as a compromised host and keep each edge server single-purpose where possible.
Keep learning
Related guides
SSH keys instead of passwords
Read more →Ransomware-resilient backups
Read more →How to Use SSH Keys Instead of Passwords for Network Devices and Servers
Passwords can be guessed, phished and reused. Create an SSH key pair, install the public key on gateways, edge servers and Linux hosts, then turn password logins off.
Read more →How to Reach Remote Sites Safely With an SSH Jump Host
Do not expose SSH on every device. Put one hardened jump host (bastion) in front of the management network and reach everything else through it.
Read more →How to Open a Device Web Page Through an SSH Tunnel
Reach the web interface of a switch, NVR or container on a remote site without opening a firewall port: forward it through SSH.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.