Almacenamiento y servicios centrales Storage and core services
Aquí ya tocaba montar algo que usara de verdad en el día a día, no solo un proyecto de práctica: un servidor de medios en casa. Todo sobre Debian, que es el sistema que ya venía usando. Encima instalé y configuré Jellyfin (el servidor de medios) y qBittorrent-nox (el cliente de torrents con su WebUI), y de ahí para adelante lo que más tiempo me llevó fue dejar las carpetas y los permisos bien atados, porque como es lo primero que tocas y no lo cuidas, luego todo son conflictos de lectura entre programas.
Así quedó la configuración de carpetas e integración:
- Estructura de directorios nativa para descargas:
/var/lib/qbittorrent/Downloads/. - Permisos de archivos: asegurar propiedad del usuario
qbittorrent(chown -R qbittorrent:qbittorrent) y permisos755/775(chmod). - Asignación de grupos: añadir el usuario
jellyfinal grupoqbittorrent(usermod -aG qbittorrent jellyfin) para que pudiera leer los medios sin líos de permisos. - Mapeo en Jellyfin: apuntar las bibliotecas exactamente a las subcarpetas de descarga.
This is where it was time to build something I'd actually use day to day, not just a practice project: a home media server. All on Debian, the system I was already using. On top of it I installed and configured Jellyfin (the media server) and qBittorrent-nox (the torrent client with its WebUI), and from there what took me the most time was getting the folders and permissions properly sorted, because that's the first thing you touch and if you don't get it right, everything ends up being read conflicts between programs.
This is how the folder setup and integration ended up:
- Native download directory structure:
/var/lib/qbittorrent/Downloads/. - File permissions: ensure ownership by the
qbittorrentuser (chown -R qbittorrent:qbittorrent) with755/775permissions (chmod). - Group assignment: add the
jellyfinuser to theqbittorrentgroup (usermod -aG qbittorrent jellyfin) so it could read media without permission headaches. - Mapping in Jellyfin: point the libraries exactly at the download subfolders.
Acceso remoto sin abrir puertos (la CG-NAT del ISP) Remote access without opening ports (my ISP's CG-NAT)
Aquí me topé con el típico problema: mi proveedor de internet me da una IP detrás de CG-NAT,
así que abrir puertos en el router directamente no era una opción real. La solución que usé
fue Tailscale, montado sobre Debian como una red privada tipo mesh. Con eso tengo acceso
remoto completo (SSH, la WebUI de qBittorrent en el puerto 8080 y Jellyfin en el 8096) todo a
través de la interfaz cifrada tailscale0, con IPs del rango 100.X.X.X.
Lo bueno de esto es que directamente me olvido del port forwarding en el router, así que tampoco tengo mi IP pública expuesta a que cualquiera la escanee.
Here I ran into the classic problem: my ISP gives me an IP behind CG-NAT, so opening ports
directly on the router wasn't really an option. The solution I used was Tailscale, set up on
top of Debian as a mesh-style private network. With that I get full remote access (SSH,
qBittorrent's WebUI on port 8080, and Jellyfin on 8096), all through the encrypted
tailscale0 interface, with IPs in the 100.X.X.X range.
The good thing about this is that I skip port forwarding on the router entirely, so I also don't have my public IP exposed for anyone to scan.
Que se mantenga solo Making it maintain itself
Y como no quiero estar pendiente de actualizar el servidor a mano cada dos por tres, dejé esto montado para que se cuidase solo:
- Configuré
unattended-upgradesyapt-listchangespara que los parches de seguridad de Debian se gestionen en segundo plano. - Habilité los
systemd timers(APT::Periodic::Unattended-Upgrade "1") conPersistent=true, para que si el servidor está apagado a la hora programada, las actualizaciones pendientes se apliquen solas en cuanto arranca de nuevo. - Configuré la limpieza automática de paquetes obsoletos (
Remove-Unused-Dependencies), que si no vas revisando de vez en cuando se te va acumulando basura.
And since I don't want to be keeping an eye on updating the server by hand every other day, I set this up to look after itself:
- I configured
unattended-upgradesandapt-listchangesso Debian's security patches get handled in the background. - I enabled
systemd timers(APT::Periodic::Unattended-Upgrade "1") withPersistent=true, so that if the server is off at the scheduled time, pending updates get applied on their own the moment it boots up again. - I set up automatic cleanup of obsolete packages (
Remove-Unused-Dependencies), since if you don't check on it once in a while, junk just piles up.