Documentation for my homelab servers.
Current servers:
I converted an old laptop I bought back in 2014 into a server. I decommissioned it from work after 6 or so years because of the dead pixels on the screen. Since a server can run headless, it’s not a big problem.
Current services I run on it:
Install Docker and Docker-Compose.
sudo apt install docker && apt install docker-compose -y
Spin up docker volumes.
sudo docker-compose up -d
Update images as needed.
sudo docker-compose up --build --force-recreate -d
Spin down docker volumes.
sudo docker-compose down
uptime-kuma:
image: louislam/uptime-kuma:1
container_name: uptime-kuma
volumes:
- [local folder path]/uptime_kuma/uptime-kuma-data:/app/data
ports:
- <Host Port>:80 # <Host Port>:<Container Port>
restart: always
transmission:
image: lscr.io/linuxserver/transmission:latest
container_name: transmission
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Manila
- TRANSMISSION_WEB_HOME=/combustion-release/ #optional
volumes:
- [local folder path]/transmission/config:/config
- [local folder path]/Torrents:/downloads
- [local folder path]/transmission/watch:/watch
ports:
- <Host Port>:9091
- <Host Port>:51413
- <Host Port>:51413/udp
restart: unless-stopped
filebrowser:
image: hurlenko/filebrowser
user: "1000:1000"
ports:
- <Host Port>:8080
volumes:
- [local folder path]:/data
- [local folder path]/filebrowser/config:/config
environment:
- FB_BASEURL=/filebrowser
restart: always
jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
user: 1000:1000
network_mode: "host"
volumes:
- [local folder path]/config:/config
- [local folder path]/cache:/cache
- [local folder path]:/media
- [local folder path]:/media2
restart: "unless-stopped"
jupyter:
image: jupyter/scipy-notebook:latest
container_name: jupyter
ports:
- <Host Port>:8888
volumes:
- [local folder path]:/home/jovyan/work
environment:
JUPYTER_ENABLE_LAB: "yes"
JUPYTER_TOKEN: "[password]"
kavita:
image: kizaing/kavita:latest # Change latest to nightly for latest develop builds (can't go back to stable)
container_name: kavita
volumes:
- [local folder path]/books:/books
- [local folder path]/kavita/config:/kavita/config
environment:
- TZ=Asia/Manila
ports:
- "<Host Port>:5000" # Change the public port (the first 5000) if you have conflicts with other services
restart: unless-stopped
pihole:
container_name: pihole
image: pihole/pihole:latest
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
ports:
- "<Host Port>:53/tcp"
- "<Host Port>:53/udp"
- "<Host Port>:80/tcp"
environment:
TZ: 'Asia/Manila'
# WEBPASSWORD: 'set a secure password here or it will be random'
# Volumes store your data between container upgrades
volumes:
- '[local folder path]/pihole/etc-pihole:/etc/pihole'
- '[local folder path]/pihole/etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
restart: unless-stopped
tailscale:
privileged: true
hostname: tailscale # This will become the tailscale device name
network_mode: "host"
container_name: tailscale
image: tailscale/tailscale:latest
volumes:
- "[local folder path]/tailscale/var_lib:/var/lib" # State data will be stored in this directory
- "/dev/net/tun:/dev/net/tun" # Required for tailscale to work
cap_add: # Required for tailscale to work
- net_admin
- sys_module
command: tailscaled
restart: unless-stopped
syncthing:
image: lscr.io/linuxserver/syncthing:latest
container_name: syncthing
hostname: ubuntuserver #optional
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Manila
volumes:
- [local folder path]/syncthing/config:/config
- [local folder path]:/sda
- [local folder path]:/sdb
ports:
- <Host Port>:8384
- <Host Port>:22000/tcp
- <Host Port>:22000/udp
- <Host Port>:21027/udp
restart: unless-stopped
nano backup.sh
#!/bin/sh
rsync -avz [put folder path of what you want to back up] [put folder path of where you want it backed up] #command for additive back-up, i.e. if you deleted the file in the originating folder, the file won't be deleted in the receiving folder.
rsync -avz --delete [put folder path of what you want to back up] [put folder path of where you want it backed up] #command for syncing as --delete will delete files on the receiving folder, i.e. if you deleted the file in the originating folder, the file will also be deleted in the receiving folder, so both folders will mirror each other.
sudo chmod +x backup.sh
sudo crontab -e
0 16 * * * sh backup.sh
Install TLP.
sudo apt install tlp
Make configuration file.
mkdir -p /etc/tlp.d
cp /etc/tlp.conf /etc/tlp.d/01-myconfig.conf
Configure.
# Set to 0 to disable, 1 to enable TLP.
# Default: 1
# TLP_ENABLE=1
Start service.
sudo tlp start
Monitor service.
sudo tlp-stat -s -c -b
Powered directly by my router, so both turn on and off at the same time.
Current services I run on it:
Serves as a back-up NAS.
Current services I run on it: