# Headless file server for entertainment



## joplass (Mar 10, 2021)

Hello good people,

I would like to have a file/entertainment server but headless. 
1. Is this possible? I did some researches but nothing notable came up.

2. The server will house music and videos and serve them using minidlna. Is this possible? I know I can remote into FreeBSD machines from other machines.

3. I have three ext4 hard drives with files. I know I can mount them and have that going.

4. I actively download football (soccer) games via torrent, legally, can this be done on a headless server? 

Thank you,


----------



## SirDice (Mar 11, 2021)

Most servers are running "headless". It just means there's no display connected to it. Which you don't need for any of the things you want to run.


----------



## rootbert (Mar 11, 2021)

joplass said:


> 4. I actively download football (soccer) games via torrent, legally, can this be done on a headless server?


aria2 is your friend, or some kind of web interface if you want to download via your browser


----------



## balanga (Mar 11, 2021)

joplass said:


> Hello good people,
> 
> I would like to have a file/entertainment server but headless.


If you install FreeBSD and enable sshd() for access by you, you effectively have a headless server.


----------



## SirDice (Mar 11, 2021)

I used to run net-p2p/transmission-daemon with www/transmission-web on a server which worked really nice.


----------



## balanga (Mar 11, 2021)

I was thinking of trying to integrate transmission with a media server such as MediaTomb (https://www.freshports.org/net/mediatomb/) but it no longer seems to be available. What would be a good alternative?

Just out of interest came across Thread 75962


----------



## SirDice (Mar 11, 2021)

balanga said:


> What would be a good alternative?


I have multimedia/plexmediaserver running. Works really nice in combination with a Plex app on my TV and Android TV boxes. It should support streaming over UPnP too. Never tried that but it should work. 

The downside of Plex is that it's closed source and you need to register. But it's free to use and works well on a FreeBSD server.


----------



## bjs (Mar 11, 2021)

I agree with SirDice... I also run multimedia/plexmediaserver and love it... For a file server, I use XigmaNAS... It is also based on FreeBSD... Both are very good and well supported through their respective forums...


----------



## joplass (Mar 11, 2021)

Thank you all for your pointers. I will get to work this weekend. I will probably come back here for any oops.


----------



## aw256 (Mar 16, 2021)

I use Kodi. It needs to run on hardware that is connected to your TV or display, but then you configure it to read your media from a file server via FTP/NFS/SMB/etc. Then Kodi will take care of building library metadata from looking at your directories.

I bought one of these: https://osmc.tv/vero/ but Kodi runs wherever.


----------



## SirDice (Mar 16, 2021)

I have several Raspberry Pis with Kodi (I like to use LibreElec for that) and an NVidia Shield with Kodi. Sharing the media with Samba is the easiest to do and will work with pretty much everything. Added bonus, run a MySQL database on your server and link Kodi too it. Then you can watch something on one device, stop playback, go to another device and resume where you left off.


----------



## joplass (Mar 19, 2021)

rootbert said:


> aria2 is your friend, or some kind of web interface if you want to download via your browser



I do now have a running server. Please I need some help setting up aria2. I am only finding guides for Linux. 

I tried the following

```
root@ignobilis:~ # service aria2 start
Starting aria2.
su: unknown login: media
/usr/local/etc/rc.d/aria2: WARNING: failed to start aria2
root@ignobilis:~ #
```

I have the following files

```
/usr/local/etc/aria2.conf

# Starts aria2c daemon when the port 1234 is accesed

description "aria2 startup script"
start on socket PROTO=inet PORT=xxxx
exec /usr/local/bin/aria2c
```

and 

```
/usr/local/etc/rc.d/aria2

#!/bin/sh
#
# $FreeBSD: branches/2021Q1/www/aria2/files/aria2.in 372266 2014-11-07 14:23:50Z zi $
#

# PROVIDE: aria2
# REQUIRE: NETWORKING
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable aria2:
#
# aria2_enable="YES"
#
# You can define flags for aria2 running. See aria2c(1) for details.
#

. /etc/rc.subr

name=aria2
rcvar=aria2_enable

command=/usr/local/bin/aria2c

# read configuration and set defaults
load_rc_config $name
aria2_enable=${aria2_enable:-"NO"}
aria2_config=${aria2_config:-"/usr/local/etc/aria2.conf"}
aria2_flags=${aria2_flags:-""}
aria2_user=${aria2_user:-"job"}
aria2_group=${aria2_group:-"wheel"}

required_files=${aria2_config}
command_args="-D --conf-path=${aria2_config} ${aria2_flags}"

run_rc_command "$1"
```


----------



## diizzy (Mar 19, 2021)

Another (more actively developed) alternative would be qbittorrent-nox which also is in ports, webfrontend works out of the box.
You might also want to have a look at Gerbera instead of Mini/ReadyDLNA. If you're using LibreELEC or CoreELEC you can also use NFS which is included in base.


----------



## joplass (Mar 19, 2021)

qbittorent-nox not working out of the box for me. I added qbittorent-nox_enable="YES" in /etc/rc.conf.

```
root@ignobilis:~ # service qbittorent-nox start
/etc/rc.conf: qbittorent-nox_enable=YES: not found
qbittorent-nox does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
```


----------



## diizzy (Mar 20, 2021)

It's qbittorrent_enable





						[ports] Contents of /head/net-p2p/qbittorrent/files/qbittorrent.in
					






					svnweb.freebsd.org
				



Line 11 and below for more information


----------



## scott_sch (Mar 20, 2021)

If your lazy and your viewer has a browser, you can just install apache24 and put a bunch of mp4's in /usr/local/www/apache24/data/movies/

Autoindex is enabled by default so whatever directories you create after "data/" will become urls and generate a basic html page with all your files.  

I mean to create a port that'll doin a nicer job of it, but this works well enough for the time being.


----------



## Lamia (Mar 20, 2021)

If you can use Sftp/ftp/bitorrent or cp to fetch your media files into a directory/samba/nfs, what next you need is one of these: jellyfin, emby-server, plex.

Jellyfin is not on freshports/FreeBSD the last time I checked. It is entirely free - a fork of emby-server.


----------



## Alain De Vos (Mar 20, 2021)

Let's say you have media files on a drive with a certain filesystem.
The main question is how do you want to access these files.
If you want to access these files using a browser you need to have certain server installed. Someone my answer this question.
For sharing files without the need of a browers there are three good working options:
1. samba (An old microsoft protocol, so your files will be accesible by Windows )
2. nfs  (file based )
3. iscsi (block based, and my preference)


----------



## Mjölnir (Mar 20, 2021)

joplass said:


> I do now have a running server. Please I need some help setting up aria2. I am only finding guides for Linux.


I can only guess.  Frequently overseen is to read through the port's message that flies through when installing multiple packages all at once.  Excerpt from my standard disclaimer:

You may want to add `message: "query '[%C/%n] %M'",` to the _ALIAS_ section of /usr/local/etc/pkg.conf, then read through all `pkg message|less` and *apply the requested settings*.
P.S.: `pkg info -D` is equivalent, but the alias above has a nicer output (`[section/portname]`) when handling multiple packages at once, and it defaults to `all` when a package name is ommited; `pkg info -D` needs at least one pkg name.


----------



## Mjölnir (Mar 20, 2021)

balanga said:


> I was thinking of trying to integrate transmission with a media server such as MediaTomb (https://www.freshports.org/net/mediatomb/) but it no longer seems to be available. What would be a good alternative?


`psearch -s mediatomb``net/gerbera               Media server compatible with DLNA and UPnP`
`portell gerbera`

```
/usr/ports/net/gerbera/pkg-descr reads:

Gerbera is a DLNA compatible media server and a continuation of MediaTomb
It allows you to browse and playback your media via your network, supports
metadata extraction, media thumbnail support and generation, media transcoding
and offers a Web UI.

WWW: https://gerbera.io/
```
`psearch -s DLNA -s media`


----------



## joplass (Mar 20, 2021)

diizzy said:


> It's qbittorrent_enable
> 
> 
> 
> ...



Good people of the forum,

So far I have no issue playing my media files remotely. I need to have some kind of torrent service running from this server serving media through out the house to be able to download files to it remotely. 

Thank you,


----------



## mefizto (Mar 20, 2021)

Hi Alain De Vos,

could you comment on why you prefer iscsi over the other options?

Kindest regards,

M


----------

