The following assumes you know some IT administration and are farmiliar with using SSH and Nano text editor.
For me a 128GB SD card is ideal since the OS is only 400Mb in size and there is plenty of room to store films.
Steps to set up :-
use a SD card and use the Pi Imager software to write a Pi lite image (no desktop) to the SD card.
before selecting to write the image, edit the settings to allow SSH log in, set your wifi to connect to and its password. set the hostname to 'minipi'. also set a user of pi and set a common password (usefull for ssh logging in).
You can use the zip file attached to this project and unzip it into the /home/pi folder on the SD card that has just been created or follow the instructions below.
edit the wpa_supplicant.conf file setting up your wifi name and password. also the hotspot name and password can be edited here for your mobile hotspot when mobile.
Once done, place the SD card in the Pi and power it on.
log in to your router and list the devices to see 'minipi' and then use this ip address to SSH into the server
run raspi-config and select advanced options. then select to expand storage to use the whole card size.
once complete reboot the pi and then log back in via SSH and run the mini-pi-setup.sh script in the /home/pi/mini-pi folder OR run the instructions below the dotted line.
The zip file contains all of the config files and a set up script that installs software and copies the config files into the correct locations.
You will be prompted for a samba password for accessing the media file shares across the network.
The script will also install Webmin to administrate this server via the web.
-------------------------------------------------------------------------------------------------------------
These are the manual instructions if you cant run the set up script 'mini-pi-setup.sh'.
sudo apt-get install -q -y nano preload samba neofetch minidlna exfat-fuse exfat-fuse zram-tools apache2
From now on, editing of any files can be done by using 'nano' text editor within the SSH terminal remoting into the minipi.
now edit the smb.conf and add at the end :-
[Media]
comment = Video-and-Music
path = /var/lib/minidlna
valid users = pi
browseable = yes
public = yes
writeable = yes
printable = no
create mask = 775
directory mask = 775
forcegroup = root
Save this file and exit.
To enable user access via network run the command 'sudo smbpasswd -a pi' and add a password.
you need to add the password twice.
make two new directories in the folder /var/lib/minidlna named Video and the other named Music.
now run 'sudo chmod 775 -Rv /var/lib/minidlna' to set the permissions for easy access and minidlna can read the media files.
save this and then open the index.html located in /var/www/html/ and overwrite everything with :-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Mini-Pi Media Server</title>
<link rel="stylesheet" href="./style.css">
<link rel="icon" href="./favicon.ico" type="image/x-icon">
</head>
<body>
<main>
<center>
<h1>Welcome to the Mini-Pi Media Server</h1>
<h1>Click links below to view and play media files or check status of media server</h1>
<br>
<br>
<br>
<div>
<h1><a href="/files">List Media Files</a></br></h1>
<br>
<h1><a id="Earth">Media Server Status</a></h1>
<script>
document.getElementById('Earth').href=''+window.location.origin+':8200';</script>
</div></br>
</div>
</center>
</main>
<script src="index.js"></script>
</body>
</html>
save this.
now edit the wpa_supplicant.conf (changing the BOLD text to suit your wifi and hotspot) located in the folder and add /etc/wpa_supplicant/ :-
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
network={
ssid="YOUR-WI-FI-NETOWRK SSID"
psk="YOUR-WIFI-PASSWORD TO CONNECT"
key_mgmt=WPA-PSK
}
network={
ssid="YOUR PHONE HOTSPOT WIFI NAME"
psk="YOUR HOTSPOT PASSWORD"
key_mgmt=WPA-PSK
}
save this and make a new file named 000-default.conf in the folder /etc/apache2/sites-enabled
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
Alias "/files" "/var/lib/minidlna"
<Directory "/var/lib/minidlna">
Options +Indexes
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
save this and reboot.
now you have a media server that you can access via network to copy video and music to / from.
to access via network you can put the name 'minipi.local' into your file explorer window and provide the user name of pi and the password you set earlier on. now you can see the Video and Music folders. now you can copy your media up to the server
You can view these files via samba network of via DLNA or even watch through a web browser (like in the pictures), via entering 'minipi.local' in the web browser or your file explorer.