Home > Linux, Software management > How To Create and Seed a Torrent in Ubuntu Using Transmission Command Line

How To Create and Seed a Torrent in Ubuntu Using Transmission Command Line

You may have a server with limited (free) monthly bandwidth, but yet need to share some large files or files that need to be accessed by a large number of people. Instead of sharing your files via your HTTP server, you can share them via BitTorrent instead in order to hopefully save bandwidth.

Here are the steps I followed on Ubuntu 11.10, but they should work with any version of Ubuntu, Debian and Mint.

  1. Install transmission client and daemon
    sudo apt-get install transmission-cli transmission-daemon
  2. Create a directory to share your files and .torrent files
    mkdir ~/p2p
  3. Copy your file in that directory and create the torrent file with transmission-cli
    transmission-create ubuntu.bin.7z -t udp://tracker.openbittorrent.com:80
  4. Start transmission-daemon
    transmission-daemon -c ~/p2p

That’s all your need to do. If you want to monitor transmission remotly via a web interface, you can instead run transmission-daemon as follows:

transmission-daemon -c ~/p2p -a public_ip

Where public_ip is the public ip of your computer. Alternatively, you could also use dynamic DNS instead.

The final step would be to share the torrent file, you can sent it to selected persons or simply share in your http server e.g.:

sudo cp ~/p2p/ubuntu.bin.7z.torrent.added /var/www/public_html/torrent
sudo chown www-data.www-data /var/www/public_html/torrent/ubuntu.bin.7z.torrent.added

Users can then download your file via BitTorrent, by download the torrent file from your server and an address that looks like:

http://www.your-server.com/torrent/ubuntu.bin.7z.torrent.added

and start download your file as they would do with any torrent.

transmission-daemon will start automatically each time you start your server, with the settings defined in /etc/transmission-daemon/settings.json and as user ‘debian-transmission’.

You’ll need to edit settings.json and add 2 lines to include the watch dir:

"watch-dir": "/home/user/p2p",
"watch-dir-enabled": true

and make sure the directory can be access by debian-transmission user:

chown debian-transmission.debian-transmission /home/user/p2p

You may also need to add “user” to debian-transmission group, if you are going to copy file to /home/user/p2p with that user:

sudo service transmission-daemon stop
sudo usermod --append -G debian-transmission user
sudo service transmission-daemon start

You can find more details about configuring transmission-daemon at https://trac.transmissionbt.com/wiki/EditConfigFiles.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

  1. GeorgeV
    June 11th, 2012 at 22:37 | #1

    Does anyone know why Chrome doesn’t allow magnets to be taken by the default torrent client on Linux Mint/Ubuntu?

  1. No trackbacks yet.