self-claimable tor web hosting in a docker container.
- Shell 67.4%
- Dockerfile 32.6%
| etc | ||
| .gitignore | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.md | ||
| watch.sh | ||
Claim This Site
Deploy a website to a Tor onion address. The site is served over HTTP and files are uploaded via SFTP over SSH, both tunneled through Tor.
How It Works
- A Tor hidden service exposes ports 80 (nginx) and 22 (sshd).
- You curl the /claim endpoint through Tor, sending your SSH public key as the User-Agent header.
- A background watcher (watch.sh) detects the key and installs it into the site user's authorized_keys.
- You scp your website files to the onion address.
- nginx serves the files at the onion URL.
Prerequisites
- Docker (or a compatible container runtime)
- netcat (/usr/bin/nc) for the SSH proxy
- tor running locally (or use the container's tor)
- curl
- ssh client (ssh-keygen, scp)
Quick Start
-
Build and start the container:
docker compose up -d -
Wait a few seconds, then grab the onion address:
docker compose exec site1 cat /var/lib/tor/hidden_service/hostname -
Claim the site (sends your public key to the server):
TOR_ADDRESS=127.0.0.1:9050 ONION=<paste-onion-address>.onion http_proxy=socks5h://${TOR_ADDRESS} \ curl -H "User-Agent: $(cat ~/.ssh/id_ed25519.pub)" \ ${ONION}/claim -
Upload your site:
scp -r -o StrictHostKeyChecking=no \ -o ProxyCommand="nc -X 5 -x ${TOR_ADDRESS} %h %p" \ /path/to/local/website/ site@${ONION}:/site/ -
Visit your site:
http_proxy=socks5h://${TOR_ADDRESS} curl ${ONION}/
Configuration
All configuration lives under etc/:
- etc/tor/torrc - Tor hidden service and SOCKS port
- etc/nginx/http.d/default.conf - nginx vhost
- etc/ssh/sshd_config - SSH daemon (SFTP-only, key auth)
- etc/supervisord.conf - process manager for all services
Docker
The Dockerfile builds an Alpine image with supervisor managing nginx, sshd, and tor. The docker-compose.yml file handles the build and a persistent volume for Tor's data directory so the onion address survives container restarts.
Security Notes
- The site user is chrooted to /var/www/html and forced into internal-sftp. No shell access is possible.
- Password authentication is disabled. Only key-based auth works.
- The /claim endpoint returns 404 by design; it only exists to trigger the key-installation watcher.
- nginx version is hidden (server_tokens off).