By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: How I Spinned up an Onion Mirror: It’s Stupidly Easy | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > How I Spinned up an Onion Mirror: It’s Stupidly Easy | HackerNoon
Computing

How I Spinned up an Onion Mirror: It’s Stupidly Easy | HackerNoon

News Room
Last updated: 2025/10/25 at 6:40 PM
News Room Published 25 October 2025
Share
SHARE

I recently spun up a .onion mirror of my website.

Why? Because why not? And also because I can. Oh, and free speech and anti-censorship and all that jazz.

I’d like to pretend that it was some grand technological challenge, but if I’m being entirely candid, it was like 3 commands and 4 lines of configuration.

If you, too, would like to become a member of the dark web, here’s how I did it:

0. Prerequisites

Before we jump into the “how” of it all, I should probably provide a brief overview of what my stack looked like before I entered The Onionverse:

  • Web Server: I’ve been using Caddy for a few years now because it’s significantly easier to configure than Nginx or Apache, and it has first-class support for modern web features like automatic HTTPS via Let’s Encrypt.
  • Hosting: My site is hosted on a VPS from DigitalOcean, which gives me full control over the server environment. It’s supposed to cost $4/mo, but I’m taking some classes at Ye Olde Community College, so I have a few years of credits to cover the cost.
  • Operating System: My server runs Debian. I like Debian. If you aren’t using an apt-based distro, then you’ll need to adjust the package installation commands accordingly (but the Tor and Caddy configurations should be the same).

1. Install Tor

First things first, we need to install Tor. On Debian, it’s right in the default repositories:

sudo apt update
sudo apt install tor

2. Configure Tor

Next, we need to configure Tor to create a hidden service for our website. Open the Tor configuration file (/etc/tor/torrc) in your favorite CLI text editor (it better be vim, or you are dead to me). I have no interest in running a relay or exit node on my VPS, so I made some minimal changes to the config file, which should look something like this (comments removed for clarity):

# Disable SOCKS proxy since we aren't making outbound connections
# through Tor
SocksPort 0

# Make sure Tor runs as a daemon (i.e. in the background)
RunAsDaemon 1

# Setup the hidden service on port 80, this is where we tell Tor to 
# create a .onion service for our web server
HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 80

# Disable inbound connections, since we aren't running a relay or
# exit node
ORPort 0

# Disable directory services, since we won't be mirroring directory
# information to other Tor nodes
DirPort 0

That’s it. Everything else should be commented out using # characters.

3. Restart Tor

Now, we need to restart the Tor service to apply our changes:

sudo systemctl restart tor

4. Get Your .onion Address

After Tor restarts, it will generate a new hidden service for us. We can find our new .onion address in the HiddenServiceDir we specified earlier (/var/lib/tor/hidden_service/). This directory is only readable by the debian-tor user, so we’ll need to use sudo to read the hostname file inside:

sudo cat /var/lib/tor/hidden_service/hostname

What will be printed to the terminal is your new .onion address. It should look something like this:

jytkco7clxwj4hhzaydhk4kr3hwzsdzyvtsc6zn2ivog5uma5pxowzad.onion

5. Configure Caddy

My Caddy server serves my website on port 80 without any IP or domain restrictions, so I don’t need to make any changes to my Caddy configuration, however, if you explicitly set up your Caddy server to only respond to certain domains or IP addresses, you’ll need to add a new site block for your .onion address, which will look something like this:

http://jytkco7clxwj4hhzaydhk4kr3hwzsdzyvtsc6zn2ivog5uma5pxowzad.onion:80 {
  # Set up a reverse proxy, or serve static files, etc.
}

Because you can’t get HTTPS certificates for .onion addresses, you’ll need to serve your site over plain HTTP. I’m not sure if this is generally considered acceptable within the Tor network (maybe one of my tens of readers can enlighten me), but I don’t require HTTPS for my site anyway, so it works for my purposes.

6. (Optional) Advertise Your .onion Address

If you want people to find your .onion site, you’ll need to advertise it somewhere. I’m a fan of subtlety, so I set up an Onion-Location header on my main site that points to my .onion address. This way, anyone visiting my regular site with a Tor-enabled browser will automatically be informed of the existence of my .onion mirror without any intrusive pop-ups, banners, or additional UI elements.

To do this, you’ll want to add a header to your main Caddy site block like so:

header {
  Onion-Location http://jytkco7clxwj4hhzaydhk4kr3hwzsdzyvtsc6zn2ivog5uma5pxowzad.onion{uri}
}

The reason I tack on that {uri} at the end is so that if someone visits a specific page on my main site (e.g. https://flower.codes/some-post), the Onion-Location header will point them to the equivalent page on my .onion site (http://jytkco7clxwj4hhzaydhk4kr3hwzsdzyvtsc6zn2ivog5uma5pxowzad.onion/some-post), which (at least to me) adds some polish to the experience.

7. Profit!

Just kidding.

At this point, your .onion mirror should be up and running. You can test it out by visiting your .onion address in any Tor-enabled browser (like the Tor Browser or even Brave, which has built-in Tor support).

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Chevy's New Bolt Electric Car Is Truly Affordable, at Less Than $30,000
Next Article Your Galaxy phone will soon know which notifications matter the most
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Homeowners Are Reusing Old iPad Tablets To Save Money On Their Smart Homes – Here’s How – BGR
News
Samsung allows bootloader unlocking on Galaxy XR after killing it on phones
News
AI data strategy powering next wave of innovation – News
News
These Are the 8 Best Foods to Help you Build Muscle Fast
News

You Might also Like

Computing

AMD Begins Sending In “New Stuff” For Their Graphics Driver In Linux 6.19

2 Min Read
Computing

The HackerNoon Newsletter: Best AI Visibility Tools for 2025 (10/25/2025) | HackerNoon

3 Min Read
Computing

What You Need to Know About Advanced Patterns for Symfony HttpClient | HackerNoon

21 Min Read
Computing

TikTok Wrongfully Banned Her Account: How Decisions Like These Impact Creators | HackerNoon

10 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?