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

ItemRequirement
HostA Mac or Linux server or VM, x86_64 (amd64) or ARM64
Container runtimeDocker 20.10 or later with Docker Compose 2.0 or later
Toolsopenssl, curl, jq
Socket accountAn organization with Socket Firewall Enterprise, and an API key with the packages:list and entitlements:list scopes
NetworkOutbound HTTPS to Docker Hub, api.socket.dev, and the public registries; inbound HTTPS (443) from clients
Name and certificateA hostname for the firewall (examples use sfw.example.com) and a TLS certificate for it. A self-signed certificate is fine for a POC
📘

Sizing

Socket 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 in

Other 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
🚧

Use docker compose, not docker-compose

The pages use the Compose v2 plugin (docker compose, with a space). The old standalone docker-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:latest

latest 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 limits

Anonymous pulls are rate-limited per IP address. If many machines share one outbound IP and pulls fail with toomanyrequests, run docker login with 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.tar

Or 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:list
  • entitlements: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

DirectionDestinationWhy
Outbound 443Docker Hub (registry-1.docker.io, auth.docker.io, production.cloudflare.docker.com)Pull the image. Not needed after the image is loaded
Outbound 443api.socket.devVerdicts for every package. Required at all times
Outbound 443registry.npmjs.org, pypi.org, files.pythonhosted.org, and any other registry you routeFetch the packages themselves
Inbound 443From developer machines and CI runnersClients 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 version shows v2 or later
  • The image is present, and its architecture matches the host (uname -m: x86_64 means amd64, aarch64 means arm64)
  • api.socket.dev and the registries answer from the firewall host
  • You have the API key and a hostname for the firewall

Troubleshooting

SymptomFix
permission denied ... /var/run/docker.sockYour user isn't in the docker group yet. Run newgrp docker or log out and back in
docker: 'compose' is not a docker commandThe Compose v2 plugin isn't installed. On Ubuntu/Debian, sudo apt install docker-compose-v2
toomanyrequests on pullDocker Hub rate limit. docker login, or pull once and distribute with docker save / docker load
exec format error when the container startsThe image architecture doesn't match the host. Pull with the right --platform
curl to api.socket.dev times outEgress is blocked. Open outbound 443, or configure the outbound proxy

Next

Block installs with Firewall.


Did this page help you?