omotam img

Skip to main content
  1. Posts/

Set up an Onion Service

··66 words·1 min· Draft
Table of Contents

torrc #

Edit the torrc:

nano /etc/tor/torrc

Add these lines:

HiddenServiceDir /var/lib/tor/my_website/
HiddenServicePort 80 127.0.0.1:80

Restart tor service:

systemctl restart tor@default

Web Server #

The Onion-Location header can be used to advertise the onion site.

nginx #

server {
    listen 80;
    server_name <your-onion-address>.onion;
    index index.html;
    root /var/www/<your-onion-address>.onion;
}

Caddy #

The http:// prefix is required to disable the automatic TLS.
http://<your-onion-address>.onion {
        root * /var/www/<your-onion-address>.onion
        file_server *
}