Tor Tutorials
Tor Onion Service Security Best Practices
Running a .onion service requires careful security configuration. A single misconfiguration can leak your server's real IP address, de-anonymizing your service. This guide covers the essential security practices for operating a Tor hidden service safely.
Need this done for your project?
We implement, you ship. Async, documented, done in days.
Prevent IP Leaks
- Bind services to localhost only — Your web server (Nginx, Apache) should listen on 127.0.0.1, not 0.0.0.0. If it binds to all interfaces, anyone can access it without Tor.
- Firewall everything — Block all incoming connections except from localhost. Only Tor should be able to reach your web server.
- Don't serve the same content on clearnet and .onion — If the same unique content is on both, correlation can reveal your server.
- Remove identifying headers — Disable Server, X-Powered-By, and other headers that reveal software versions.
- Disable access logs — Don't log visitor IPs (they're Tor exit nodes anyway, but the practice matters).
Harden the Server
- Use a dedicated server for the onion service — don't share with other services
- Keep Tor, web server, and OS fully updated
- Use AppArmor or SELinux to restrict Tor's permissions
- Run services as non-root users with minimal permissions
- Disable unnecessary services (sendmail, avahi, cups, etc.)
- Use unattended-upgrades for automatic security patches
Protect Against Attacks
- DDoS protection — .onion services are vulnerable to DDoS. Use OnionBalance for load distribution and rate limiting in your web server.
- Guard discovery attacks — Use Vanguards (included in recent Tor versions) to protect your guard nodes from being identified.
- Application security — SQL injection, XSS, and other web vulnerabilities can be exploited to reveal server information. Audit your application.
Use AnubizHost for Managed Security
Getting all of this right is complex and a single mistake can compromise your anonymity. AnubizHost provides pre-hardened Tor hosting where all these security measures are already in place. We handle the infrastructure security so you can focus on your content.
Related Services
Why Anubiz Labs
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.