pt

Configurar .onion Service - Tutorial Completo em Portugues

Um .onion service permite hospedar um site ou servico acessivel apenas via rede Tor, sem revelar o IP real do servidor. Esta e a forma mais privada de hospedar conteudo online. Este tutorial cobre a configuracao completa em Ubuntu 22.04 com Nginx.

Need this done for your project?

We implement, you ship. Async, documented, done in days.

Start a Brief

Prerequisitos

O que voce precisa:

  • VPS com Ubuntu 22.04 (ou Debian 12). Pode ser hospedagem na Islandia ou Romania.
  • Acesso root via SSH.
  • Conectividade de saida na porta 443 (para o daemon Tor se conectar a rede).

Nao precisa de dominio .com/.org. O endereco .onion e gerado automaticamente.

Instalacao do Tor daemon

Instalando Tor no Ubuntu/Debian:

  1. Adicione o repositorio oficial do Tor Project:
apt install apt-transport-https gpg -y
curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --dearmor -o /usr/share/keyrings/tor-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/tor-archive-keyring.gpg] https://deb.torproject.org/torproject.org $(lsb_release -c -s) main" > /etc/apt/sources.list.d/tor.list
apt update && apt install tor deb.torproject.org-keyring -y

Configuracao do hidden service

Editando /etc/tor/torrc:

HiddenServiceDir /var/lib/tor/my_hidden_service/
HiddenServicePort 80 127.0.0.1:80
HiddenServiceVersion 3
  1. Reinicie Tor: systemctl restart tor
  2. Aguarde ~30 segundos para o no anunciar na rede.
  3. Seu endereco .onion: cat /var/lib/tor/my_hidden_service/hostname

O endereco sera algo como: duskgytldkxiuqc6.onion (v2, descontinuado) ou xxxxx...xxxxx.onion (v3, 56 caracteres). Use sempre v3.

Configuracao do Nginx

Servindo o site na porta 80 local:

  1. Instale Nginx: apt install nginx -y
  2. Configure /etc/nginx/sites-available/onion:
server {
    listen 127.0.0.1:80;
    server_name _;
    root /var/www/html;
    index index.html;
}
  1. Ative: ln -s /etc/nginx/sites-available/onion /etc/nginx/sites-enabled/ && nginx -t && systemctl reload nginx

Acesse seu endereco .onion via Tor Browser para verificar que funciona.

Seguranca do .onion service

Precaucoes para manter o anonimato do servidor:

  • Configure o Nginx para nao revelar informacoes de servidor: server_tokens off;
  • Remova headers que possam identificar o servidor: proxy_hide_header X-Powered-By;
  • Nao misture o .onion service com servicos que tenham IP publico no mesmo servidor, se quiser separacao total.
  • Backup da chave privada do .onion: /var/lib/tor/my_hidden_service/hs_ed25519_secret_key - guarde com seguranca.

Why Anubiz Host

100% async — no calls, no meetings
Delivered in days, not weeks
Full documentation included
Production-grade from day one
Security-first approach
Post-delivery support included

Ready to get started?

Skip the research. Tell us what you need, and we'll scope it, implement it, and hand it back — fully documented and production-ready.

Anubiz Chat AI

Online