Tor /



$ doas pkg_add tor


Now edit the torrc file

$ doas $EDITOR /etc/tor/torrc
RunAsDaemon 1

HiddenServiceDir /path/to/whare/you/want/the/dir/files # This can be any path it just has to exist
HiddenServicePort <Port 1><Port 2> # for 99.99% of the time you can just set port 1 and 2 as the same port

since tor is going to runned as _tor user, make sure it has required permissions.

to add more ports just add more HiddenServicePort to add more .onion links just add more HiddenServiceDir with HiddenServicePort undernet

make sure the HiddenServiceDir path is owned by the user who will run Tor and has permission of 700 and then simply run tor using

$ tor

as the user you want to run Tor with and it will start

to get .onion address run $ doas cat /path/to/whare/you/want/the/dir/files/hostname

$ doas rcctl enable tor
$ doas rcctl start tor