A comprehensive automation script that transforms a Linux Mint Xfce laptop into a fully functional home server with NAS, VPN, and media streaming capabilities.
- Overview
- Features
- Requirements
- Quick Start
- Script Walkthrough
- Web Setup Guide
- Access Guide
- Usage Guide
- Troubleshooting
- FAQ
This script automates the process of converting a Linux Mint Xfce laptop into a home server. It is designed with beginners in mind, providing interactive guidance through each step of the setup process.
A HomeLab is a personal server setup that you control. It allows you to run your own media streaming service, file storage, and secure VPN without relying on third-party subscriptions.
| Objective | Description |
|---|---|
| NAS Setup | Network Attached Storage for accessing files from any device |
| VPN Exit Node | Route internet traffic through your home network from anywhere |
| Media Server | Stream movies and TV shows to any device |
| Remote Access | Secure access to your server from anywhere using Tailscale |
This script is designed and tested for Linux Mint Xfce Edition.
Why Xfce is recommended:
- Uses approximately 400MB RAM at idle compared to 1-2GB for other desktop environments
- Minimal resource usage maximizes server application performance
- Optimal for older hardware or maximizing available resources
- Stable foundation for 24/7 server operation
The script may function on other Linux Mint editions (Cinnamon, MATE), but Xfce provides the best performance for server workloads.
After running this script, your system will have:
A web-based control panel for managing your server and installing applications.
A self-hosted media streaming solution compatible with:
- Mobile devices (phones and tablets)
- Desktop computers
- Smart TVs
- Gaming consoles
File access from anywhere:
- Document, photo, and video storage
- Cross-device file sharing
- Data backup capabilities
Secure remote access features:
- Global access to your server
- End-to-end encryption
- Exit node functionality
- No router configuration required
- A dedicated laptop or computer for server use
- Wired Ethernet connection (recommended) or stable WiFi
- Storage drive for media files (internal or external)
- Linux Mint Xfce Edition (other editions not officially supported)
- Active internet connection
- Tailscale account (free, created during setup)
- Basic terminal usage
- Web browser navigation
Open a terminal and run:
git clone https://github.com/your-username/HomeLab-Automation.git
cd HomeLab-AutomationOr download directly:
wget https://raw.githubusercontent.com/your-username/HomeLab-Automation/main/setup_homelab.shsudo bash setup_homelab.shThe script provides interactive guidance through each step.
The script verifies it is running with sudo privileges, which are required for system configuration and software installation.
Verifies the operating system is Linux Mint and checks for the Xfce desktop environment. The script is optimized for this specific configuration.
Updates package repositories and installs curl if not present. This ensures access to the latest software information and download capabilities.
Downloads and executes the official CasaOS installer. CasaOS provides a web-based interface for server management and application installation.
Duration: 3-10 minutes depending on internet speed
Installs the Tailscale VPN client and initiates authentication. Tailscale creates a secure private network for remote access without complex router configuration.
Configures the system for VPN exit node functionality:
- Enables IP forwarding in
/etc/sysctl.d/99-tailscale.conf - Sets
net.ipv4.ip_forward = 1 - Sets
net.ipv6.conf.all.forwarding = 1 - Configures UFW firewall rules for SSH and Tailscale
- Advertises the machine as a Tailscale exit node
Displays SSH and SFTP connection details for remote server access.
Provides instructions for configuring power settings to prevent the laptop from sleeping when the lid is closed. This is a manual GUI configuration step.
Creates the media directory structure:
/DATA/Media/Movies/DATA/Media/Shows
Sets appropriate file permissions for media access.
Displays server information including IP addresses, access URLs, and configuration details.
Timing: During Step 3 of the script
- Open a web browser
- Navigate to
http://YOUR_LOCAL_IP - Create an account with username and password
- Save the password for future access
Timing: During Step 4 of the script
- The script displays an authentication URL
- Open the URL in a browser
- Log in to your Tailscale account or create one
- Authorize the machine when prompted
- Return to the terminal to confirm success
Timing: During Step 5 of the script
- Navigate to https://login.tailscale.com/admin/machines
- Locate your server in the machine list
- Open the menu and select "Edit route settings"
- Enable "Use as exit node"
- Select "Disable key expiry" to prevent automatic disconnection every 90 days
Timing: After script completion
- Access CasaOS at
http://YOUR_LOCAL_IP - Open the App Store
- Search for "Jellyfin"
- Install the application
- Access Jellyfin at
http://YOUR_LOCAL_IP:8097
Note: Jellyfin uses port 8097 in CasaOS, not the default 8096.
| Type | Use Case | Address |
|---|---|---|
| Local Access | Connected to home network | Local IP address |
| Remote Access | Away from home | Tailscale IP address |
Remote access requires Tailscale to be installed and connected on the client device.
Local:
http://YOUR_LOCAL_IP:8097
Remote:
http://YOUR_TAILSCALE_IP:8097
Web Browser:
Navigate to http://YOUR_IP:8097 in Chrome, Firefox, or Edge.
Jellyfin Desktop App:
- Download from https://jellyfin.org/downloads/
- Install and configure with server address:
- Local:
http://YOUR_LOCAL_IP:8097 - Remote:
http://YOUR_TAILSCALE_IP:8097
- Local:
Jellyfin Media Player: Download from https://github.com/jellyfin/jellyfin-media-player/releases for improved video playback and hardware acceleration support.
Web Browser:
Navigate to http://YOUR_IP:8097 in Safari, Chrome, or Firefox.
Jellyfin Media Player: Download the .dmg from https://github.com/jellyfin/jellyfin-media-player/releases
Infuse (App Store): Premium application with native interface and excellent playback performance.
Web Browser:
firefox http://YOUR_IP:8097Jellyfin Media Player:
# Debian/Ubuntu/Mint
sudo dpkg -i jellyfin-media-player_*.deb
# Flatpak
flatpak install flathub com.github.iwalton3.jellyfin-media-playerJellyfin (Play Store):
Official application. Configure with server address http://YOUR_IP:8097.
Findroid (Play Store): Alternative client with Material Design interface.
Remote Access Setup:
- Install Tailscale from Play Store
- Authenticate with your Tailscale account
- Connect to your network
- Use Tailscale IP in Jellyfin configuration
Jellyfin (App Store):
Official application. Configure with server address http://YOUR_IP:8097.
Swiftfin (App Store): Alternative client with native iOS design.
Remote Access Setup:
- Install Tailscale from App Store
- Authenticate and connect
- Use Tailscale IP in client configuration
Android TV / Google TV: Install Jellyfin from Play Store.
Amazon Fire TV: Install from Amazon App Store or sideload the Android APK.
LG webOS / Samsung Tizen:
Use the built-in web browser to access http://YOUR_IP:8097 or use DLNA.
Apple TV: Install Swiftfin from App Store.
| Protocol | Description | Security |
|---|---|---|
| SFTP | Secure File Transfer Protocol | Encrypted |
| SMB/CIFS | Windows file sharing | Network-level |
| SSH | Secure shell access | Encrypted |
SFTP is recommended for cross-platform compatibility and security.
/DATA/Media/
├── Movies/
└── Shows/
WinSCP (Recommended):
- Download from https://winscp.net/
- Configure connection:
- File Protocol: SFTP
- Host name: YOUR_IP
- Port: 22
- User name: YOUR_LINUX_USERNAME
- Password: YOUR_LINUX_PASSWORD
- Navigate to
/DATA/Media/
FileZilla:
- Download from https://filezilla-project.org/
- Quick Connect:
- Host:
sftp://YOUR_IP - Username: YOUR_LINUX_USERNAME
- Password: YOUR_LINUX_PASSWORD
- Port: 22
- Host:
Finder:
- Press
Cmd + Kor select Go > Connect to Server - Enter
sftp://YOUR_IP - Authenticate with Linux credentials
- Navigate to
/DATA/Media/
Cyberduck: Download from https://cyberduck.io/ and configure SFTP connection.
File Manager (GUI):
Nautilus:
sftp://YOUR_USERNAME@YOUR_IP
Thunar:
sftp://YOUR_USERNAME@YOUR_IP
Dolphin:
sftp://YOUR_USERNAME@YOUR_IP
Terminal:
sftp username@YOUR_IPCommon commands:
ls- List filescd /DATA/Media- Change directoryget filename- Download fileput filename- Upload fileexit- Disconnect
Mount as Network Drive:
sudo apt install sshfs
mkdir ~/homelab
sshfs username@YOUR_IP:/DATA/Media ~/homelab
# Unmount
fusermount -u ~/homelabSolid Explorer (Play Store):
- Menu > New cloud connection > SFTP
- Configure:
- Server: YOUR_IP
- Port: 22
- Username: YOUR_LINUX_USERNAME
- Password: YOUR_LINUX_PASSWORD
Material Files (Play Store/F-Droid): Add FTP server with SFTP protocol.
CX File Explorer (Play Store): Network > Remote > SFTP
Secure ShellFish (App Store): Configure server connection for Files app integration.
FE File Explorer (App Store): Add SFTP connection with server details.
Documents by Readdle (App Store): Connections > Add Connection > SFTP
Windows Terminal / PowerShell:
ssh YOUR_USERNAME@YOUR_IPPuTTY:
- Download from https://putty.org/
- Host Name: YOUR_IP
- Port: 22
ssh YOUR_USERNAME@YOUR_IPssh YOUR_USERNAME@YOUR_IPTermux (F-Droid/Play Store):
pkg install openssh
ssh YOUR_USERNAME@YOUR_IPJuiceSSH (Play Store): GUI-based SSH client.
Termius (App Store): Add host with server details.
Access the dashboard:
- Local:
http://YOUR_LOCAL_IP - Remote:
http://YOUR_TAILSCALE_IP
Common tasks:
- Install applications from App Store
- Monitor system resources on dashboard
- Manage files through the Files application
- Configure system settings
Recommended Directory Structure:
Movies:
/DATA/Media/Movies/
├── Inception (2010)/
│ └── Inception.mkv
├── The Matrix (1999)/
│ └── The Matrix.mkv
└── Interstellar (2014)/
└── Interstellar.mkv
TV Shows:
/DATA/Media/Shows/
├── Breaking Bad/
│ ├── Season 1/
│ │ ├── S01E01.mkv
│ │ └── S01E02.mkv
│ └── Season 2/
│ └── S02E01.mkv
└── The Office/
└── Season 1/
└── S01E01.mkv
Configuring Jellyfin Libraries:
- Access Jellyfin at
http://YOUR_IP:8097 - Navigate to Dashboard > Libraries
- Add Library:
- Movies:
/DATA/Media/Movies - Shows:
/DATA/Media/Shows
- Movies:
- Jellyfin will scan and retrieve metadata automatically
Route all internet traffic through your home network:
Windows/Mac/Linux:
- Open Tailscale application
- Select your server
- Enable "Use as exit node"
Android:
- Open Tailscale application
- Access menu
- Select "Use exit node"
- Choose your server
iOS:
- Open Tailscale application
- Select your server
- Enable "Use as Exit Node"
- Connect via SFTP using preferred client
- Navigate to
/DATA/Media/Movies/or/DATA/Media/Shows/ - Create folder with proper naming convention
- Upload files
Naming convention for optimal metadata matching:
- Correct:
Inception (2010) - Incorrect:
Inception
Symptoms: Browser displays connection error or continuous loading
Solutions:
- Wait 30-60 seconds and refresh
- Check service status:
sudo systemctl status casaos-gateway
- Restart service:
sudo systemctl restart casaos-gateway
Symptoms: Cannot reach server via Tailscale IP
Solutions:
- Check status:
tailscale status
- Re-authenticate:
sudo tailscale up
- Verify firewall:
sudo ufw status
Symptoms: Jellyfin cannot access media files
Solutions:
- Verify permissions:
ls -la /DATA/Media/
- Correct permissions:
sudo chown -R YOUR_USERNAME:YOUR_USERNAME /DATA sudo chmod -R 775 /DATA
- Configure Jellyfin environment variables in CasaOS:
Verify IDs with:
PUID = 1000 PGID = 1000id
Symptoms: Connection refused or timeout
Solutions:
- Check SSH service:
sudo systemctl status ssh
- Start SSH:
sudo systemctl start ssh sudo systemctl enable ssh - Verify firewall:
sudo ufw allow ssh
Symptoms: Server becomes unreachable after period of inactivity
Solutions:
- Open Power Manager from Applications menu
- System tab: Set "When laptop lid is closed" to "Switch off display"
- Apply for both battery and plugged in modes
- Disable screen saver and auto-suspend
Is this free?
Yes. CasaOS, Jellyfin, and Tailscale are free. Tailscale offers free personal use for up to 100 devices.
Can I use old hardware?
Yes. Most laptops from the past 10-15 years are suitable.
What is the power consumption?
Laptops are efficient. Expect approximately $2-5 per month in electricity costs.
Is it secure?
Yes. Tailscale uses WireGuard encryption. SFTP is encrypted. Data remains on your hardware.
Why Xfce instead of a headless server OS?
Xfce provides a GUI for management while remaining lightweight. It is suitable for users who prefer visual feedback.
Can I install additional applications?
Yes. CasaOS App Store includes Nextcloud, Plex, Home Assistant, Pi-hole, and others.
What if my IP address changes?
Tailscale provides a fixed IP that remains constant regardless of ISP changes.
What video formats does Jellyfin support?
Most common formats including MKV, MP4, and AVI. Jellyfin can transcode unsupported formats.
Can multiple users stream simultaneously?
Yes. Performance depends on CPU capabilities for transcoding.
How does metadata retrieval work?
Jellyfin automatically downloads metadata when files are properly named (e.g., "Movie Name (Year)").
Contributions are welcome:
- Bug reports
- Feature suggestions
- Documentation improvements
- Pull requests
This project is available under the MIT License.
Author: Shreyas Mene
Version: 0.0.1