Personal tools

Headless Linux Fileserver

From Dtella Wiki

Jump to: navigation, search

This is a quickstart tutorial on getting a headless dtella fileserver running quickly on Linux distributions.


Overview of Steps

  1. Download microdc2 from your distribution repository (or compile)
  2. Run microdc2 once to generate configuration files
  3. Edit ~/.microcd2/config to set up sharing
  4. Download Dtella from Get the one for Linux
  5. Start a 'screen' and start microdc2 and dtella
  6. Create a script to easily start dtella and microdc2.


Software you'll need:

  • microdc2 - a lightweight no frills DC++ client that is perfect for setting up a small dtella server on.
  • screen - a tool commonly used to keep applications running on a computer after a user logs out (sometimes already installed)
  • SysV or systemd - program that starts all other programs (usually already installed)
  • dtella



  • Get dtella and place it in your home directory
tar xvf dtella-purdue-1.2.7.tar.bz2
rm dtella-purdue-1.2.7.tar.bz2
  • Run microdc2 in the terminal to generate the config directory, then close it.
  • Open up ~/.microdc2/config with your favorite text editor. Here is an example configuration. Be sure to replace the fields in brackets with proper values.
set listenport 1555
set active on
set auto_reconnect on
# The following enables logging. Replace the logfile with wherever you want it to log to. You can of course turn it off by leaving the following two lines blank
set log_charset UTF-8
set logfile /home/[USER]/.microdc2/log
# These should all be pretty self-explanatory. Nick is your nickname. If the hub requires a password, specify one here.
set description A dtella filesharing server
set nick [NICK]
set downloaddir /home/[USER]/downloads
# The set speed option doesn't actually change anything, it only changes your REPORTED speed that other users see. The slot is how many simultaneous downloads people can get from you.
set speed somerandomstring
#This is how many people can download from you at any given time
set slots 4
#This is the hub connect command, it should be left until last
#Set your shared directories here
share /home/[USER]/Music
share /home/[USER]/Games
share /home/[USER]/Movies

Network Configuration

Dtella uses two ports for its connection (TCP for file transfer, and UDP for connecting to the hub). We will use ports 1555 (TCP) and 1666 (UDP) for consistency with other tutorials, but they can be set to whatever you want (You will have to change these if you want to run two clients from the same subnet). Remember to port forward these.

You already set port 1555 in microdc2's config, so now run the dtella python script to set the other port.

python /path/to/dtella/

Now in the shell, run:

 !udp 1666 

the changes are now written to the config.

Connecting to Dtella

With the dtella python script still running, open up microdc2 and test your connection to dtella.


You should see a loading bar appear briefly and then the message "Sync Complete; You're Online!"

Your server is now online and sharing files with other users! You can also get files using microdc2 with the search, results, browse and get commands. You must have shared at least 5GB to download from other users.

Creating a Script

In your dtella folder, create a script to launch and microdc2

python /home/[USER]/dtella-purdue-1.2.7/ &
microdc2 -c /home/[USER]/.microdc2/config

Make sure this script is executable

sudo chmod +x [dtella_microdc2]

Run this script to make sure that it works.

Run at Startup

You don't want to manually run your script every time your computer starts up, so well use an init system to do this automatically. systemd is currently the recommended way of doing this, but you can use SysV for systems that don't support it.


Create a new file in "/etc/systemd/system/dtella.service" with the following contents".

Description=microdc2 Dtella Server
ExecStart=/usr/bin/screen -L -d -m -S dtella /home/[USER]/dtella-purdue-1.2.7/dtella_microdc2
ExecStop=/usr/bin/screen -S dtella -X quit

Now execute these commands to reload systemd and enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable dtella.service
sudo systemctl start dtella.service

SysV init

Open the file "/etc/rc2.d/S99local" and append the following line, adding in the complete path to your startup script. If the file does not already exist, create it.

su - [USER] -c "screen -dmS dtella /home/[USER]/dtella-purdue-1.2.7/dtella_microdc2"

Make the script executable.

sudo chmod +x /etc/rc2.d/S99local


Your script should now start at reboot. You can connect to your server using

screen -x dtella

Detach by either closing the window or typing "Ctrl+a" and then hit "d".

Congraturrations! Yuu now dterra masta.