Self-Hosting on the Dark Web
Article URL: https://david.alvarezrosa.com/posts/self-hosting-on-the-dark-web/ Comments URL: https://news.ycombinator.com/item?id=49870295 Points: 172 # Comments: 57
This website can only be accessed via the Tor network on a .onion domain, which is only visible within the Tor network. To access it, one must use the Tor Browser. The address is not tied to any certificate authority, DNS, or IP address, as it is generated from a public key. Tor ensures end-to-end encryption for all traffic as it travels through numerous volunteer-run servers, maintaining the anonymity of both the user and the server.
The Tor Project, a non-profit organization, promotes internet freedom and privacy through open-source software. Users are encouraged to support the project or become a relay. To self-host on Tor, install Tor and create a dedicated directory for the service, ensuring it is not the web root. Edit the torrc file, specifying the Tor-owned path and restricting access permissions.
Point the hidden service to the site files, restarting Tor when prompted. The generated address will forward port 80 to 127.0.0.1:8080, necessitating an nginx server block for configuration. Since Tor operates on plain TCP, the web server only needs to listen on that port. For static sites, a second copy must be built with the onion as the base URL, as clearnet builds include absolute links pointing to the clearnet domain.
Automate the deployment process by building the site once per target (clearnet and Tor) upon every push and syncing each to its respective web root. The full configuration can be found in the homelab repository, and the site's GitHub Actions workflow handles the build and deployment of the Tor copy. To access this site over Tor, visit dhevt6e4rtgbtr3jh53xrpwmgtilkah6nyjujocsspssrsexc7omxhid.onion.
Rewritten by urgent.news; may contain errors — check the original.
Source: david.alvarezrosa.com
