# Self-Hosting on the Dark Web

DevFeed: [Self-Hosting on the Dark Web](<https://devfeed.tech/articles/self-hosting-on-the-dark-web-60981.md>)

Original publisher: [Read original article](<https://david.alvarezrosa.com/posts/self-hosting-on-the-dark-web/>)

Author: David Álvarez Rosa

Published: 2026-06-01T09:55:00Z

Content type: tutorial

Language: en

Sources: [David Álvarez Rosa](<https://devfeed.tech/sources/david-alvarez-rosa.md>)

Topics: [Self-hosted](<https://devfeed.tech/topics/self-hosted.md>), [tor](<https://devfeed.tech/topics/tor.md>), [Jamstack](<https://devfeed.tech/topics/jamstack.md>), [nginx](<https://devfeed.tech/topics/nginx.md>), [Hugo](<https://devfeed.tech/topics/hugo.md>), [Domain Name System (DNS)](<https://devfeed.tech/topics/dns-resolution-process.md>), [QUIC](<https://devfeed.tech/topics/quic.md>), [Virtual Private Network](<https://devfeed.tech/topics/vpn.md>)

Tags: [0-1](<https://devfeed.tech/tags/0-1.md>), [hugo](<https://devfeed.tech/tags/hugo.md>), [nginx](<https://devfeed.tech/tags/nginx.md>), [self-hosting](<https://devfeed.tech/tags/self-hosting.md>), [tor](<https://devfeed.tech/tags/tor.md>)

## AI overview

A tutorial explains how to publish a static site as a Tor hidden service. It covers configuring Tor to forward traffic to a local port, serving the onion address with nginx, and building and deploying a separate copy with Hugo so links use the onion base URL.

## Source excerpt

This site is now reachable over Tor as a hidden service, at a .onion address that resolves only inside the Tor network.1 Tor relays and encrypts your traffic as it passes through thousands of volunteer-run servers, so that no single party can link who you are to what you are doing; a hidden service extends that anonymity to the server itself. It's built by the nonprofit Tor Project, which advances human rights and freedoms through free software and open networks, so that anyone can use the internet free from tracking, surveillance, and censorship. The network only works because people use it, so consider supporting them or running a relay--your contribution helps millions stay safe and private online every day. The hidden service § Install Tor and point a hidden service at a local port. Edit /etc/tor/torrc HiddenServiceDir /var/lib/tor/blog/ HiddenServicePort 80 127.0.0.1:8080 The directory must be a dedicated, Tor-owned path--not your web root.2 Restart Tor and read the address it generates $ sudo systemctl restart tor@default $ sudo cat /var/lib/tor/blog/hostname dhevt6e4rtgbtr3jh53xrpwmgtilkah6nyjujocsspssrsexc7omxhid.onion Serving the site § Tor forwards the onion's port 80 to 127.0.0.1:8080, so the web server just needs to listen there. Add an nginx server block for it--no TLS, no HTTP/2, no QUIC, since Tor speaks plain TCP and provides its own encryption. server { listen 127.0.0.1:8080; server_name dhevt6e4rtgbtr3jh53xrpwmgtilkah6nyjujocsspssrsexc7omxhid.onion; root /srv/tor.david.alvarezrosa.com; index index.html; error_page 404 /404/index.html; location / { try_files $uri $uri/ =404; } } Reload nginx and the site is live on Tor. Building for the onion § A static site bakes its base URL into absolute links, so a clearnet build would point visitors back to the clearnet domain even when served over Tor. The fix is to build a second copy with the onion as its base URL $ hugo --minify --baseURL="http://dhevt6e4rtgbtr3jh53xrpwmgtilkah6nyjujocsspssrsexc7omxhid.onion/"