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 Stand up Socket Firewall for the first time.
Checklist
| Item | Requirement |
|---|---|
| Host | A Linux server or VM, x86_64 (amd64) or ARM64. macOS or Windows for local testing only |
| 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 token with the packages:list and entitlements:list scopes |
| Network | Outbound HTTPS to Docker Hub, api.socket.dev, fw.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 |
Sizing
Allocate 4 CPUs when developer machines and CI install through the firewall directly. Allocate 2 CPUs when the firewall sits behind Artifactory or Nexus and sees only requests not cached by the artifact manager.
Memory requirements depend on whether metadata filtering is on. Allocate 1 GB per CPU with metadata filtering off. Allocate 2 GB per CPU with metadata filtering on.
| Deployment | CPUs | Memory, metadata filtering off | Memory, metadata filtering on |
|---|---|---|---|
| Developers and CI install through the firewall | 4 | 4 GB | 8 GB |
| The firewall sits behind Artifactory or Nexus | 2 | 2 GB | 4 GB |
Redis is optional and needs a 2 GB memory limit. Add that 2 GB to the firewall's memory when both run on one host. Details are in the Redis cache page.
Run more instances behind a load balancer and point them at one Redis to handle more traffic than one instance.
Throughput estimates for other sizes are in Resource-based recommendations. Sizing by team size for a firewall behind an artifact manager is in the Upstream Deployment Guide.
1. Install Docker and the tools
Ubuntu 22.04 / 24.04:
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 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.
Get the image on a restricted host
Pull on a machine that has access, then move the image:
# On the connected machine. Replace X.Y.Z with the version tag. Match the target's architecture: linux/amd64 or linux/arm64
docker pull --platform linux/amd64 socketdev/socket-registry-firewall:X.Y.Z
docker save socketdev/socket-registry-firewall:X.Y.Z -o socket-registry-firewall-X.Y.Z.tar
# Copy the .tar to the firewall host, then:
docker load -i socket-registry-firewall-X.Y.Z.tarOr push it to your internal container registry and pull from there. The firewall still needs outbound HTTPS to fw.socket.dev, api.socket.dev and the upstream registries at runtime. If your policy requires building images yourself, see the tarball method in the Installation Guide.
The host has only the tag you loaded. Use that tag wherever these pages write latest: in the docker image inspect command under Verify on this page, and on the image: line of docker-compose.yml on the next page. Skip the hello-world check under Verify on this host because it pulls an image from Docker Hub.
3. Create the API token
Dashboard → Settings → API Tokens → create a token with these scopes:
packages:listentitlements:list
This token goes in the firewall's .env on the next page. It doesn't need policy or admin scopes. The Policy config automation examples use a separate admin token.
4. Open the network paths
| Direction | Destination | Why |
|---|---|---|
| Outbound 443 | Docker Hub (registry-1.docker.io, auth.docker.io, production.cloudfront.docker.com) | Pull the image. Not needed after the image is loaded |
| Outbound 443 | fw.socket.dev, 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://fw.socket.dev | head -1
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) -
fw.socket.dev,api.socket.devand the registries answer from the firewall host - You have the API token 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: unknown command: docker compose or docker: 'compose' is not a docker command | The Compose v2 plugin isn't installed. On Ubuntu, 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 fw.socket.dev or api.socket.dev times out | Egress is blocked. Open outbound 443, or configure the outbound proxy |
Next
Updated 13 days ago