Prerequisites
What you need before you start, and how to get the Socket Firewall image from Docker Hub.
Everything on this page is needed before Block installs with Firewall. Plan on about 15 minutes for a fresh Linux VM.
Checklist
| Item | Requirement |
|---|---|
| Host | A Mac or Linux server or VM, x86_64 (amd64) or ARM64 |
| Container runtime | Docker 20.10 or later with Docker Compose 2.0 or later |
| Tools | openssl, curl, jq |
| Socket account | An organization with Socket Firewall Enterprise, and an API key with the packages:list and entitlements:list scopes |
| Network | Outbound HTTPS to Docker Hub, api.socket.dev, and the public registries; inbound HTTPS (443) from clients |
| Name and certificate | A hostname for the firewall (examples use sfw.example.com) and a TLS certificate for it. A self-signed certificate is fine for a POC |
SizingSocket doesn't publish minimum sizing. These pages were tested on a 4 vCPU / 6 GB Ubuntu 24.04 VM. Start there for a POC and watch CPU and memory under your real install load.
1. Install Docker and the tools
Ubuntu 22.04 / 24.04 or Debian 12 (least work, using the distribution's packages):
sudo apt update
sudo apt install -y docker.io docker-compose-v2 openssl curl jq
sudo usermod -aG docker "$USER"
newgrp docker # or log out and back inOther Linux distributions: follow Install Docker Engine for your distribution, which includes the Compose plugin, then install openssl, curl, and jq with your package manager.
macOS or Windows (local testing only): Docker Desktop includes Compose. Use a Linux host for anything other people will depend on.
Check the versions:
docker --version # 20.10 or later
docker compose version # v2.0 or later
Usedocker compose, notdocker-composeThe pages use the Compose v2 plugin (
docker compose, with a space). The old standalonedocker-compose(v1) is not supported.
2. Pull the firewall image
The image is published on Docker Hub as socketdev/socket-registry-firewall. It is public, so no Docker Hub login is needed.
docker pull socketdev/socket-registry-firewall:latestlatest is fine for a POC. For anything longer-lived, pin a version tag from the Docker Hub page (for example :2.16.0) and use the same tag in docker-compose.yml, so a restart never pulls an unexpected upgrade.
Docker Hub rate limitsAnonymous pulls are rate-limited per IP address. If many machines share one outbound IP and pulls fail with
toomanyrequests, rundocker loginwith any Docker Hub account first.
No internet access on the firewall host?
Pull on a machine that has access, then move the image:
# On the connected machine. Match the target's architecture: linux/amd64 or linux/arm64
docker pull --platform linux/amd64 socketdev/socket-registry-firewall:2.16.0
docker save socketdev/socket-registry-firewall:2.16.0 -o socket-registry-firewall-2.16.0.tar
# Copy the .tar to the firewall host, then:
docker load -i socket-registry-firewall-2.16.0.tarOr push it to your internal container registry and pull from there. The firewall still needs outbound HTTPS to api.socket.dev and the upstream registries at runtime. If your policy requires building images yourself, see the tarball method in the Installation Guide.
3. Create the API key
Dashboard → Settings → API Tokens → create a key with these scopes:
packages:listentitlements:list
This key goes in the firewall's .env in the next page. It doesn't need policy or admin scopes. The Policy config automation examples use a separate admin key.
4. Open the network paths
| Direction | Destination | Why |
|---|---|---|
| Outbound 443 | Docker Hub (registry-1.docker.io, auth.docker.io, production.cloudflare.docker.com) | Pull the image. Not needed after the image is loaded |
| Outbound 443 | api.socket.dev | Verdicts for every package. Required at all times |
| Outbound 443 | registry.npmjs.org, pypi.org, files.pythonhosted.org, and any other registry you route | Fetch the packages themselves |
| Inbound 443 | From developer machines and CI runners | Clients reach the firewall |
If outbound traffic must go through a corporate proxy, see the outbound proxy settings in the Configuration Reference.
Verify
docker run --rm hello-world | grep -i "hello from docker"
docker compose version
docker image inspect socketdev/socket-registry-firewall:latest --format '{{.Architecture}}'
curl -sI https://api.socket.dev | head -1
curl -sI https://registry.npmjs.org | head -1- Docker runs a container without
sudo -
docker compose versionshows v2 or later - The image is present, and its architecture matches the host (
uname -m:x86_64meansamd64,aarch64meansarm64) -
api.socket.devand the registries answer from the firewall host - You have the API key and a hostname for the firewall
Troubleshooting
| Symptom | Fix |
|---|---|
permission denied ... /var/run/docker.sock | Your user isn't in the docker group yet. Run newgrp docker or log out and back in |
docker: 'compose' is not a docker command | The Compose v2 plugin isn't installed. On Ubuntu/Debian, sudo apt install docker-compose-v2 |
toomanyrequests on pull | Docker Hub rate limit. docker login, or pull once and distribute with docker save / docker load |
exec format error when the container starts | The image architecture doesn't match the host. Pull with the right --platform |
curl to api.socket.dev times out | Egress is blocked. Open outbound 443, or configure the outbound proxy |
Next
Updated 1 day ago