🐳 Tiny Docker image (🤏 10MB) as 🧅 Tor SOCKS5 proxy 🛡
Find a file
Peter Dave Hello 767f9f6bda
Merge pull request #65 from PeterDaveHello/renovate/alpine-3.x
Update Alpine Linux Docker base image to v3.21
2024-12-12 01:28:47 +08:00
.github Upgrade to GitHub-native Dependabot 2021-04-29 19:05:30 +00:00
.dockerignore Update .dockerignore to ignore .github/ 2021-05-28 23:32:54 +08:00
.travis.yml Update node.js on Travis CI from v12 to v18 2022-06-17 02:02:02 +08:00
docker-compose.yml Limit the whole Tor process to tor user, change default DNSPort to 8853 2021-01-25 22:58:10 +08:00
Dockerfile Update alpine Docker tag to v3.21 2024-12-11 13:09:10 +00:00
LICENSE Add LICENSE 2023-02-04 22:57:47 +08:00
README.md Add DigitalOcean sponsor information in README 2024-02-29 22:55:28 +08:00
renovate.json Add renovate.json 2019-11-24 08:41:25 +00:00
torrc Limit the whole Tor process to tor user, change default DNSPort to 8853 2021-01-25 22:58:10 +08:00

Tor-socks-proxy

license Build Status Docker Hub pulls

Docker Hub badge

The super easy way to set up a Tor SOCKS5 proxy server inside a Docker container, without Tor relay/exit node function enabled.

Docker image Repository

We push the built image to Docker Hub and GitHub Container Registry:

Use the prefix ghcr.io/ if you prefer to use GitHub Container Registry.

Usage

First-Time Setup

docker run -d --restart=always --name tor-socks-proxy -p 127.0.0.1:9150:9150/tcp peterdavehello/tor-socks-proxy:latest
  • --restart=always: This ensures the container automatically restarts whenever the system reboots.
  • -p 127.0.0.1:9150:9150/tcp: This binds the container to localhost, and you should not change this IP unless you want to expose the proxy to a local network or the Internet.
    • You can change the first 9150 to any available port. Please note that ports 9050/9150 may be occupied if you are running another Tor client like TorBrowser.

Start or stop an existing Instance manually

docker start tor-socks-proxy
docker stop tor-socks-proxy

Checking the Proxy Status and logs

docker logs tor-socks-proxy

Configuring a Client to Use the Proxy

curl --socks5-hostname 127.0.0.1:9150 https://ipinfo.tw/ip

Stopping the Proxy

docker stop tor-socks-proxy

IP Renewal

By default, Tor automatically changes IPs every 10 minutes. You can manually renew the IP by restarting the container:

docker restart tor-socks-proxy

DNS over Tor

Publish DNS port during setup to query DNS requests over Tor:

docker run -d --restart=always --name tor-socks-proxy -p 127.0.0.1:9150:9150/tcp -p 127.0.0.1:53:8853/udp peterdavehello/tor-socks-proxy:latest

Sponsor

This project is now sponsored by DigitalOcean, providing us with a dedicated development and testing environment.

For cloud VPS hosting with $200 in free credit, consider using my DigitalOcean referral link: https://m.do.co/c/1fdd0a1d695a

Support Tor Project

Support the Tor project by setting up Tor bridge/exit nodes and donating.