In today’s dynamic web environment, proxy servers are indispensable tools for managing network traffic, enhancing security, and improving performance. Among the myriad of proxy solutions available, 3proxy stands out as a robust and lightweight option. This document introduces a streamlined approach to deploying 3proxy using Docker, simplifying the setup and configuration process for users of all levels. This Docker image encapsulates the stable version of 3proxy, ensuring reliability and ease of use through environment variable configurations. By default, it’s pre-configured for anonymous proxy operation, prioritizing client privacy and logging activity in a structured JSON format for efficient analysis.
Explore the Docker Hub page for this image here.
This Docker image exposes the following TCP ports:
Port number | Description |
---|---|
3128 |
HTTP proxy – for web traffic proxying |
1080 |
SOCKS proxy – for versatile application proxying |
Available Docker Image Tags
Docker tags are used to version and differentiate Docker images. This 3proxy-docker
image offers a variety of tags for different needs and preferences.
Registry | Image |
---|---|
GitHub Container Registry | ghcr.io/tarampampam/3proxy |
Docker Hub (mirror) | tarampampam/3proxy |
Important Tagging Strategy:
For production environments, it is highly discouraged to use the latest
tag. Major updates can introduce breaking changes, potentially disrupting your services. For stable and predictable deployments, utilize specific version tags in the X.Y.Z
format. This ensures version consistency and simplifies rollback procedures if necessary.
A comprehensive list of all supported image tags can be found on Docker Hub.
Multi-Architecture Support:
Starting from version 1.8.2
, this Docker Proxy Server image supports multiple architectures, including both amd64
and arm64
. This ensures compatibility across a wider range of hardware platforms.
docker run --rm mplatform/mquery ghcr.io/tarampampam/3proxy:1.8.2 Image: ghcr.io/tarampampam/3proxy:1.8.2 <span>*</span> Manifest List: Yes (Image type: application/vnd.docker.distribution.manifest.list.v2+json) <span>*</span> Supported platforms: - linux/amd64 - linux/arm64
Configuration via Environment Variables
This Docker proxy server image is designed for easy customization through environment variables. This approach allows for flexible configuration without modifying the image itself, ideal for containerized environments and orchestration platforms.
Variable Name | Description | Example |
---|---|---|
PROXY_LOGIN |
Username for proxy authentication. If set, enables basic authentication. | username |
PROXY_PASSWORD |
Password for proxy authentication. Must be set if PROXY_LOGIN is used. |
password |
EXTRA_ACCOUNTS |
Define additional proxy user accounts in JSON format. Useful for managing multiple users. | {"evil":"live", "guest":"pass"} |
PRIMARY_RESOLVER |
Primary DNS resolver for the proxy server. | 8.8.8.8:5353/tcp |
SECONDARY_RESOLVER |
Secondary DNS resolver for fallback and redundancy. | 2001:4860:4860::8844 |
MAX_CONNECTIONS |
Sets the maximum allowed concurrent connections to the proxy server. | 2056 |
PROXY_PORT |
Custom port for the HTTP proxy server. | 8080 |
SOCKS_PORT |
Custom port for the SOCKS proxy server. | 8888 |
EXTRA_CONFIG |
Append custom 3proxy configuration directives to the main configuration file. | # line 1n# line 2 |
LOG_OUTPUT |
Specify the path for log output. Set to /dev/null to disable logging entirely. |
/tmp/3proxy.log |
Kubernetes Deployment with Helm Chart
For users operating in Kubernetes environments, deploying this 3proxy Docker image is further simplified with a dedicated Helm chart. Helm, the package manager for Kubernetes, allows for streamlined installation, upgrade, and management of applications.
The Helm chart for this 3proxy-docker
image is available on ArtifactHUB, a central repository for Kubernetes packages.
Quick Start Guide: Using the Docker Proxy Server Image
Getting started with the 3proxy-docker
image is incredibly straightforward. Below are a few common use cases to illustrate its simplicity.
Basic Run Command:
This command starts a basic 3proxy container, exposing the default HTTP (3128) and SOCKS (1080) ports.
docker run --rm -d -p "3128:3128/tcp" -p "1080:1080/tcp" ghcr.io/tarampampam/3proxy:1
Running with Authentication and Custom DNS Resolvers:
This example demonstrates how to enable proxy authentication and configure custom DNS resolvers using environment variables.
docker run --rm -d -p "3128:3128/tcp" -p "1080:1080/tcp" -e "PROXY_LOGIN=evil" -e "PROXY_PASSWORD=live" -e "PRIMARY_RESOLVER=2001:4860:4860::8888" ghcr.io/tarampampam/3proxy:1
Docker Compose Example:
For more complex setups or persistent configurations, Docker Compose is an excellent tool. Here’s a sample docker-compose.yml
file:
services:
3proxy:
image: ghcr.io/tarampampam/3proxy:1
environment:
PROXY_LOGIN: evil
PROXY_PASSWORD: live
MAX_CONNECTIONS: 10000
PROXY_PORT: 8000
SOCKS_PORT: 8001
PRIMARY_RESOLVER: 77.88.8.8
SECONDARY_RESOLVER: 8.8.8.8
ports:
- '8000:8000/tcp'
- '8001:8001/tcp'
Release Management
Releasing new versions of the 3proxy-docker
image is a simple process:
- Commit and push your changes to the repository.
- Create a new release on the GitHub repository’s releases page.
Upon publishing a new release, the Docker images are automatically built and pushed to both GitHub Container Registry and Docker Hub.
latest
Tag Update:
It’s important to note that the latest
tag in both registries is automatically updated to point to the newest release.
Community Support
We encourage community involvement and appreciate feedback. If you encounter any issues or have suggestions for improvements, please don’t hesitate to open an issue in the repository.
To report bugs, request features, or ask questions, please open a new issue on GitHub.
Licensing Information
This project is open-source and distributed under the permissive WTFPL License. You are free to use, modify, and distribute it as you see fit.