I was not able to buy a Raspberry Pi 4 so I am now using my old Lenovo ThinkPad T440s as my home server replacing the old Raspberry Pi 2 that became too slow for my current needs.
Main goals of my home server are network wide ad blocking and a media server with automated movies and TV shows downloads accessible also from the outside thanks to Tailscale.
- Plex Media Server
- Sonaar
- Radarr
- FlareSolverr
- Transmission
- AdGuardHome
- Homepage
- Home Assistant
- Prowlarr
- Shinkro
- Tailscale
Most of the software runs in Docker for easier management. See docker-compose.yml for exact configuration.
mkdir docker-services
cd docker-services
wget https://raw.githubusercontent.com/igorkulman/thinkserver/main/docker-compose.yml
docker-compose up -d
I encountered problems where Docker containers were not able to access DNS, probably because of AdGuardHome. I fixed it by setting Docker DNS to directly use Cloudflare and Google DNS.
sudo nano /var/snap/docker/current/config/daemon.json # because Ubuntu Server
{ "dns" : [ "1.1.1.1" , "8.8.8.8" ] }
sudo snap restart docker
Tailscale needs to be installed directly
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --advertise-exit-node --accept-dns=false
To be able to use Plex over Tailscale I had to add its Tailscale address (http://100.x.y.z:32400) to Settings
| Network
| Custom server access URLs
(only visible after showing advanced settings).
The Thinkpad T440s includes a smaller internal battery and a bigger removable external battery. I removed the external battery to prolong its lifespan and reduce the heat generated charging it.
sudo nano /etc/systemd/logind.conf
set HandleLidSwitch=ignore
, LidSwitchIgnoreInhibited=no
and
sudo service systemd-logind restart
Based on https://askubuntu.com/a/1117586
sudo apt-get install acpi-support vbetool
sudo echo "event=button/lid.*" > /etc/acpi/events/lid-button
sudo echo "action=/etc/acpi/lid.sh" >> /etc/acpi/events/lid-button
wget https://raw.githubusercontent.com/igorkulman/thinkserver/main/lid.sh
chmod +x lid.sh
sudo cp lid.sh /etc/acpi/lid.sh
Based on https://askubuntu.com/a/619881
sudo apt-get install msr-tools
wget https://raw.githubusercontent.com/igorkulman/thinkserver/main/turbo-boost.sh
chmod +x turbo-boost.sh
./turbo-boost.sh disable
sudo modprobe -r iwlwifi # Wi-Fi
sudo modprobe -r btusb # Bluetooth
sudo modprobe -r snd_hda_intel # Sound
Based on https://rhea.dev/articles/2017-07/Home-server-Power-saving
sudo apt-get install powertop
sudo powertop --calibrate
wget https://raw.githubusercontent.com/igorkulman/thinkserver/main/powertop.service
sudo cp powertop.service /lib/systemd/system/powertop.service
sudo systemctl enable --now powertop
Disabling the red power LED on the lid is not really a power saving features, it is more an annoyance to remove, especially when the Thinkpad is placed in some visible place.
wget https://raw.githubusercontent.com/igorkulman/thinkserver/main/led-off.sh
chmod +x led-off.sh
./led-off.sh
In idle all the docker containers are running but just AdGuardHome responds to DNS queries from my network, the other containers do not really do anything.
State | Power usage |
---|---|
Idle | 5 W |
Plex (playback) | 8 W |
Plex (playback with transcoding) | 17 W |
All the measurements were done with Solight DT26.
wget https://raw.githubusercontent.com/igorkulman/thinkserver/main/shares.conf
sudo nano /etc/samba/smb.conf
add
include = /home/igorkulman/shares.conf
and restart Samba
sudo service smbd restart
NFS is faster than Samba so I prefer it for accessing the data from macOS machines.
sudo apt install nfs-kernel-server
sudo nano /etc/exports
add
/media/data/downloads *(rw,sync,no_subtree_check,root_squash,insecure)
/media/data/backup *(rw,sync,no_subtree_check,root_squash,insecure)
/media/data/Movies *(rw,sync,no_subtree_check,root_squash,insecure)
/media/data/TVShows *(rw,sync,no_subtree_check,root_squash,insecure)
and reload NFS
sudo exportfs -a
sudo systemctl restart nfs-kernel-server