3proxy
Docker image with 3proxy - Tiny free proxy server
100K+
3proxyβ is a tiny, battle-tested proxy server with 20+ years in production. It speaks HTTP/HTTPS, SOCKSv4/5, FTP, SMTP, supports IPv4/IPv6, DNS caching, ACLs, proxy chaining, load balancing, and a plugin system - all in a single lightweight binary, written in pure C.
This repository ships the stable version of 3proxy as a Docker image with a set of practical improvements over the vanilla upstream build:
dumb-init included - signals from Docker and other container runtimes are forwarded correctly; no orphaned
child processesamd64, arm64, arm/v7, ppc64le, s390x-a): X-Forwarded-For and Via are
never added, so the destination server sees a direct request rather than a proxied one| Variable Name | Description | Example |
|---|---|---|
LOG_OUTPUT | Path for log output (/dev/stdout by default; set to /dev/null to disable logging) | /tmp/3proxy.log |
PRIMARY_RESOLVER | Primary DNS resolver (1.0.0.1 by default) | 8.8.8.8:5353/tcp |
SECONDARY_RESOLVER | Secondary DNS resolver (8.8.4.4 by default) | 2001:4860:4860::8844 |
MAX_CONNECTIONS | Maximum number of connections (512 by default); requires ulimit nofile β₯ 2Γvalue | 2056 |
DNS_CACHE_SIZE | DNS cache size (65536 by default) | 5000 |
PROXY_LOGIN | Authorization login (empty by default) | username |
PROXY_PASSWORD | Authorization password (empty by default) | password |
PROXY_PORT | HTTP proxy port (3128 by default) | 8080 |
SOCKS_PORT | SOCKS proxy port (1080 by default) | 8888 |
EXTRA_ACCOUNTS | Additional proxy users (format login:password;login2:password2, empty by default) | evil:live;guest:pass |
EXTRA_CONFIG | Raw 3proxy config lines injected before proxy/socks directives (empty by default) | # line 1\\n# line 2 |
PROXY_EXTRA_ARGS | Extra arguments appended to the proxy directive (empty by default) | -ocTCP_NODELAY -osTCP_NODELAY |
SOCKS_EXTRA_ARGS | Extra arguments appended to the socks directive (empty by default) | -ocTCP_NODELAY -osTCP_NODELAY |
Download the latest binary for your OS/architecture from the releases pageβ , or use the Docker image:
| Registry | Image |
|---|---|
| GitHub Container Registryβ | ghcr.io/tarampampam/3proxy |
| Quay.ioβ (mirror) | quay.io/tarampampam/3proxy |
| Docker Hubβ (mirror) | tarampampam/3proxy |
Warning
Using the `latest` tag for Docker images is strongly discouraged, as it may introduce backward-incompatible changes during **major** upgrades. Use versioned tags in the `X`, `X.Y`, or `X.Y.Z` format instead.
Supported image architectures - linux/amd64, linux/arm/v7, linux/arm64, linux/ppc64le, linux/s390x.
All images are signed with Cosignβ using keyless signing (GitHub OIDC).
Docker Image Content:
Permission UID:GID Size Filetree
---------- ------------- ------- -----------------------------------
drwxr-xr-x 0:0 7.1 MB βββ bin
-rwxr-xr-x 0:0 6.6 MB β βββ 3proxy
-rwxr-xr-x 0:0 64 kB β βββ dumb-init
-rwxr-xr-x 0:0 338 kB β βββ lua
-rwxr-xr-x 0:0 63 kB β βββ portcheck
-rwxr-xr-x 0:0 8.9 kB βββ entrypoint.lua
drwxr-xr-x 0:0 218 kB βββ etc
drwxr-xr-x 10001:10001 0 B β βββ 3proxy
-rw-r--r-- 0:0 16 B β βββ group
-rw-r--r-- 0:0 49 B β βββ passwd
drwxr-xr-x 0:0 218 kB β βββ ssl
drwxr-xr-x 0:0 218 kB β βββ certs
-rw-r--r-- 0:0 218 kB β βββ ca-certificates.crt
drwxrwxrwt 0:0 0 B βββ tmp
A Helm chart for Kubernetes is included with each release (downloadβ ), published on Artifact Hubβ , and also available via an OCI registry (Helm v3.8+ required):
helm install the3proxy \
oci://ghcr.io/tarampampam/3proxy/charts/the3proxy \
--version X.Y.Z
All supported chart values, examples, and usage instructions can be found at Artifact Hubβ .
Helm chart sources are located in the deploy/helmβ directory of the repository.
Starts HTTP and SOCKS5 proxies on their default ports with no credentials required. Anyone who can reach the ports can use the proxy, so only do this on a trusted/private network.
docker run --rm -d \
-p "3128:3128/tcp" \
-p "1080:1080/tcp" \
ghcr.io/tarampampam/3proxy:2
Enables basic username/password authentication. Requests without valid credentials receive
407 Proxy Authentication Required. Also sets a custom primary DNS resolver.
docker run --rm -d \
-p "3128:3128/tcp" \
-p "1080:1080/tcp" \
-e "PROXY_LOGIN=user" \
-e "PROXY_PASSWORD=secret" \
-e "PRIMARY_RESOLVER=2001:4860:4860::8888" \
ghcr.io/tarampampam/3proxy:2
Runs the proxy on custom ports with authentication and a higher connection limit. Because each connection
needs two file descriptors, MAX_CONNECTIONS: 10000 requires ulimit nofile to be at least 20000.
services:
3proxy:
image: ghcr.io/tarampampam/3proxy:2
environment:
PROXY_LOGIN: evil
PROXY_PASSWORD: live
MAX_CONNECTIONS: 10000
PROXY_PORT: 8080
SOCKS_PORT: 1080
PRIMARY_RESOLVER: 1.0.0.1
SECONDARY_RESOLVER: 8.8.8.8
ports:
- '8080:8080/tcp'
- '1080:1080/tcp'
ulimits:
nofile:
soft: 20000
hard: 20000
If /etc/3proxy/3proxy.cfg exists when the container starts, the entrypoint skips config generation entirely and
passes the file directly to 3proxy. All env-var settings are ignored in this case.
Docker CLI:
docker run --rm -d \
-p "3128:3128/tcp" \
-p "1080:1080/tcp" \
-v "$(pwd)/3proxy.cfg:/etc/3proxy/3proxy.cfg:ro" \
ghcr.io/tarampampam/3proxy:2
Docker Compose:
services:
3proxy:
image: ghcr.io/tarampampam/3proxy:2
volumes:
- ./3proxy.cfg:/etc/3proxy/3proxy.cfg:ro
ports:
- '3128:3128/tcp'
- '1080:1080/tcp'
The startup logic lives in /entrypoint.lua (a Lua 5.5 script). You can replace it by mounting your own file over
that path, or by passing a different CMD.
Mount a custom Lua entrypoint (Docker CLI):
docker run --rm -d \
-p "3128:3128/tcp" \
-v "$(pwd)/my-entrypoint.lua:/entrypoint.lua:ro" \
ghcr.io/tarampampam/3proxy:2
Override CMD with a script at an arbitrary path (Docker Compose):
services:
3proxy:
image: ghcr.io/tarampampam/3proxy:2
volumes:
- ./my-entrypoint.lua:/my-entrypoint.lua:ro
command: ["/bin/lua", "/my-entrypoint.lua"]
ports:
- '3128:3128/tcp'
The original
entrypoint.luain this repository is a good starting point - copy and adapt it to your needs.
Commands:
# build the image locally
docker build --tag 3proxy:local .
# run the locally built image and smoke-test both proxies
docker run --rm -d --name 3proxy_local -p "3128:3128/tcp" -p "1080:1080/tcp" 3proxy:local
curl -sx http://localhost:3128 https://httpbin.org/ip # HTTP proxy
curl -sx socks5://localhost:1080 https://httpbin.org/ip # SOCKS5 proxy
docker stop 3proxy_local
# lint the Helm chart
helm lint --strict ./deploy/helm
# regenerate Helm chart README from the template (requires helm-docs)
helm-docs -c ./deploy/helm/ -t README.tpl.md -o README.md
# test the Helm chart in a local kind cluster
kind create cluster --name 3proxy-dev
kind load docker-image 3proxy:local --name 3proxy-dev
helm install the3proxy ./deploy/helm \
--set image.repository=3proxy --set image.tag=local \
--set config.auth.login=user --set config.auth.password=secret \
--wait
kubectl run smoke --image=curlimages/curl:latest --restart=Never --rm -i \
-- curl --fail --proxy http://the3proxy:3128 --proxy-user user:secret https://httpbin.org/ip
kind delete cluster --name 3proxy-dev
If you encounter any issues, please open an issueβ in this repository.
This project is licensed under the WTFPL. Use it freely and enjoy!
Content type
Image
Digest
sha256:1f93a082aβ¦
Size
2.9 MB
Last updated
8 days ago
docker pull tarampampam/3proxy