https://github.com/phx/docktor
Host a Tor hidden service inside a Docker container without exposing any clearnet ports.
https://github.com/phx/docktor
Last synced: about 1 year ago
JSON representation
Host a Tor hidden service inside a Docker container without exposing any clearnet ports.
- Host: GitHub
- URL: https://github.com/phx/docktor
- Owner: phx
- License: mit
- Created: 2020-02-25T19:06:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-28T11:49:29.000Z (over 3 years ago)
- Last Synced: 2025-03-24T04:40:58.727Z (about 1 year ago)
- Language: Dockerfile
- Size: 35.2 KB
- Stars: 46
- Watchers: 3
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README




# Docktor
Docktor allows you to host a darkweb hidden service by connecting to Tor only over the `docker0` interface.
The container proxies Tor traffic to its own localhost via `nginx` and serves up the content in the `hiddenservice` directory, via host/container volume mapping as the `nginx` document root.
No ports are mapped between the host and the container, but it wouldn't be a bad idea to lock down the `docker0` interface using `iptables` for good measure, but there are zero clearnet ports exposed in this setup.
---
## Install via GitHub
- `git clone https://github.com/phx/docktor.git`
- `cd docktor`
- `docker build -t docktor.img .`
- `docker run -d -v "${PWD}/hiddenservice:/var/www/hiddenservice" --name docktor docktor.img`
## Install via DockerHub
- `mkdir -p hiddenservice`
- `touch hiddenservice/error.html`
- `echo 'Welcome to the darkweb.' > hiddenservice/index.html`
- `docker run -d -v "${PWD}/hiddenservice:/var/www/hiddenservice" --name docktor lphxl/docktor:latest`
Your `.onion` hostname will be listed in `./hiddenservice/hostname`, which you can access over Tor to view the content served in that directory.
---
### Notes
Anytime you remove the container and start a new one using the `docker run` command, your `.onion` hostname will change.
If you want to keep serving content from the same Tor domain, keep the same container and just use the normal Docker commands:
- `docker stop docktor`
- `docker start docktor`
- `docker exec -it docktor /bin/bash` (to exec into the container)
---
I will post additional instructions for running this after I push it to DockerHub and will also consider writing a `docker-compose` file.