Skip to content

Configuration for my home server running on an old Thinkpad T440s

Notifications You must be signed in to change notification settings

igorkulman/thinkserver

Repository files navigation

ThinkServer

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.

Dashboard

Main goal

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.

Software

Docker

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

Docker DNS

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

Direct installation

Tailscale needs to be installed directly

curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up --advertise-exit-node --accept-dns=false

Plex over Tailscale

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).

Reduce power consumption

Remove external battery

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.

Disable sleep on lid close

sudo nano /etc/systemd/logind.conf

set HandleLidSwitch=ignore, LidSwitchIgnoreInhibited=no and

sudo service systemd-logind restart

Turn off display when lid closed

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

Disable Turbo Boost

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

Disable unused hardware

sudo modprobe -r iwlwifi # Wi-Fi
sudo modprobe -r btusb # Bluetooth
sudo modprobe -r snd_hda_intel # Sound

PowerTOP

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

Disable the red LED

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

Power consumption measurements

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.

Network shares

Samba

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

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

About

Configuration for my home server running on an old Thinkpad T440s

Topics

Resources

Stars

Watchers

Forks

Languages