Setting up a headless torrent daemon in FreeBSD en

By drm on Wednesday 14 April 2010 19:46 - Comments (11)
Categories: Linux / BSD, Tips, tips, tips ..., Views: 7.036

I have FreeBSD running as a home server for a while now. One of the things I wanted the server to take care of is downloading torrents, so I could shut down my PC whenever I am downloading stuff.

With transmission-daemon (net-p2p/transmission-daemon from ports) this is really simple. To install:
cd /usr/ports/net-p2p/transmission-daemon && make install clean

To fire up:
/usr/local/etc/rc.d/transmission onestart
or add transmission_enable=YES to your /etc/rc.conf and run
/usr/local/etc/rc.d/transmission start

There's a few gotcha's, though:

The settings file transmission uses lives in /usr/local/etc/transmission/home/settings.json. This file is overwritten by transmission on startup, so that isn't the place to put your custom configurations. After doing a bit of reading of the rc script (/usr/local/etc/rc.d/transmission), I found out that the easiest way to configure transmission-daemon for your needs is editing your /etc/rc.conf and adding a transmission_flags var. This var is passed as parameters to transmission-daemon, so check out
transmission-daemon --help
for available options.

My transmission rc config looks like this (in /etc/rc.conf):
transmission_flags="-a 192.168.178.*,127.0.0.* --incomplete-dir /var/spool/transmission -w /srv/files/download -e /var/log/transmission.log" --paused
  • -a makes sure both the web client (available at port 9091 when transmission-daemon is running) and the transmission-remote cli tool are accessible by the specified addresses
  • --incomplete-dir is used to store incomplete downloads while downloading.
  • -w is the "work" dir, where files are stored when completed, and while downloading if --incomplete-dir isn't running
  • -e tells transmission to log messages and warnings to /var/log/transmission, especially useful while configuring transmission or you're encountering errors
  • --paused makes sure the daemon is started, but all torrents are paused. You need to start the torrents manually by using either the web interface (running at port 9091 by default) or using the transmission-remote command line utility
I have created the necessary files and folders with the transmission user and group as the owner. As root:
install -d {/var/spool/transmission,/srv/files/download} -g transmission -u transmission -m 644
touch /var/log/transmission.log && chown transmission:transmission /var/log/transmission.log

As always, you need to restart the daemon after changing settings, so call
/usr/local/etc/rc.d/transmission restart
after doing your modifications to /etc/rc.conf.

Of course you need to make sure the drives the directories live in have enough space left, or you might run into some weird results.

Happy torrenting :)

Volgende: ReTwizzle this: #lorizzle 10-'10 ReTwizzle this: #lorizzle
Volgende: My top 5 dos and don'ts of self-explanatory programming 03-'10 My top 5 dos and don'ts of self-explanatory programming


By Tweakers user Phyxion, Wednesday 14 April 2010 20:46

Too bad multi user environment is missing.

By Tweakers user drm, Wednesday 14 April 2010 22:08

Do you mean running multiple instances for different users?

By Tweakers user i-chat, Wednesday 14 April 2010 22:26

i had your exact same issue with the setting.json file,
try setting a reset signal i think it was kill -HUP transmission (on linux)

try and read the manual ... anyway that will let the tranmssion re-read its config file and than your changes WILL work, i think they are shifting to a new deamon style like /etc/inet.d/transmisson start|stop|reload (once again stil in linux) rather than just the first two ....

hope this helps

By Tweakers user MikeN, Wednesday 14 April 2010 23:17

* MikeN uses rTorrent. Has a nice ncurses interface and works fine :)

[Comment edited on Wednesday 14 April 2010 23:18]

By netranger1989, Thursday 15 April 2010 14:41

Use Torrentflux this is multiuser ready and it haves A WebGui.


By Tweakers user Phyxion, Thursday 15 April 2010 19:47

"Do you mean running multiple instances for different users?"

Single instance/webclient with different users.
Torrentflux works but is old and very ugly.

[Comment edited on Thursday 15 April 2010 19:47]

By Tweakers user drm, Saturday 17 April 2010 12:06

Hm, I don't have any purpose for serving to multiple clients, so I didn't really check for that. I'm pretty happy as it is now :)

By brian, Monday 03 May 2010 22:28

As normal user if you run transmission-daemon from the cli and pass settings such as,

transmission-daemon --paused --encryption-required --config-dir ~/.transmission --watch-dir ~/.transmission/watch \
--incomplete-dir ~/.transmission/incomplete \
--download-dir ~/.transmission/complete

you'll find some folders and a settings.json in ~/.config/transmission/

Perhaps you could then set the transmission_flags in /etc/rc.conf so it reads $HOME/.config/transmission for a per user setup?

By Tweakers user drm, Tuesday 04 May 2010 11:36

makes sense :)

By Drey, Tuesday 04 January 2011 10:31

Okay, good, but option "-a 192.168.178.*" didn't work for me (FreeBSD 8.0).
replaced wildcard with normal IP.
Tried custom port for web-interface - didn't succeed. All seems to be ok, but browser can't connect (my comments: https://forum.transmissio...=10041&p=51545#p51545).

By henryg, Sunday 09 October 2011 15:48

(for headless system)

found out (from transmission website) that in order to make settings in settings.json permanent, you need to stop the transmission daemon prior to editing the file otherwise your settings will be reset to their previous version.

so there is no need to pass all those flags in /etc/rc.conf, all you need to do is stop the daemon, configure settings.json to your needs and restart.

Comments are closed