Installing Tor as a Windows Service
If you want to install Tor as a service in Windows, then you need an Expert Bundle. It can be downloaded from the same
page of the official website.
From the downloaded archive tor-winXX-0.X.X.X.zip ) unzip the Tor folder to the root of the C drive.
To install the service, just run the command:
C:/Tor/tor.exe --service install
You can install the service using various
Tor command line options.
We need a configuration file, so create it in the C:Tor directory, this file should have the name torrc:
echo( > C:/Tor/torrc
To check whether the service is started with the settings file (whether it contains errors), you can use this command:
C:/Tor/tor.exe -f "C:Tortorrc"
Now install the Tor service, which will read the settings from the file C:/Tor/torrc:
C:Tor/tor.exe --service install -options -f "C:Tor/torrc"
Remember that options can be specified after the -options flag, otherwise they will be ignored.
To start and stop the service, use the commands:
C:Tor/tor.exe --service start
C:Tor/tor.exe --service stop
To delete a service:
C:Tor/tor.exe --service stop
C:Tor/tor.exe --service remove
Note that you need to stop the service first and then delete it.
By default, the Tor service listens on port 9050, so you can check if it is started by a command that shows if port 9050 is being listened to:
netstat -aon | findstr ":9050"