Skip to content

Building Your Home Server - Hardware & OS Installation

Introduction Have an old laptop gathering dust? Don't throw it away. That old MacBook Air can become a powerful, energy-efficient home server. In this guide, I'll walk through transforming a 2015 MacBook Air into a production-ready Ubuntu server. Why repurpose an old laptop? ✅ Free hardware (already paid for) ✅ Built-in battery backup (UPS) ✅ Low power consumption (~10-20W) ✅ Small form factor ✅ Built-in keyboard/screen for troubleshooting What you'll need: Old laptop (MacBook Air, any old PC) External SSD (optional, but recommended) USB Ethernet adapter (for stable networking) 8GB+ USB flash drive for installation Step 1: Choosing Your Hardware My setup uses a MacBook Air 2015 with: Intel i5-5250U (1.6GHz dual-core) 8GB RAM External 1TB SSD (for OS and data) Why external SSD? The internal SSD is broken, and I had an external SSD lying around, so the cost was minimal. Step 2: Creating Bootable Ubuntu USB Download Ubuntu Server 24.04 LTS from ubuntu.com. On macOS (to create bootable USB): bash # Convert ISO to IMG hdiutil convert -format UDRW -o ubuntu.img ubuntu-24.04-live-server-amd64.iso # Find your USB drive diskutil list # Write to USB (replace X with your disk number) sudo dd if=ubuntu.img of=/dev/rdiskX bs=1m # Eject when done diskutil eject /dev/diskX Step 3: Installing Ubuntu Server Plug in the USB drive and external SSD to your MacBook Air Hold Option (⌥) key while booting Select the USB drive Choose "Try or Install Ubuntu Server" Select language and keyboard layout Partitioning (for external SSD): Partition Size Filesystem Mount Point Purpose sda1 1GB FAT32 /boot/efi EFI boot sda2 rest ext4 / Root filesystem Create user m01 (or your username) Install SSH server (check the box) Wait for installation to complete Remove USB and reboot Step 4: First Boot & Initial Configuration Log in with your username and password. bash # Check your IP address ip addr show # Update package lists sudo apt update # Upgrade all packages sudo apt upgrade -y # Check disk usage df -h Step 5: Setting Static IP Address The USB Ethernet adapter needs a static IP to ensure it stays reachable. bash # Identify your network interface ip link show Look for enx... or eth0 – this is your network interface. bash # Create netplan configuration sudo nano /etc/netplan/00-installer-config.yaml Configuration: yaml network: version: 2 renderer: networkd ethernets: enx00e04c6800f5: # Your interface name dhcp4: false addresses: - 000.000.1.100/24 routes: - to: default via: 000.000.1.1 nameservers: addresses: [1.1.1.1] bash # Apply configuration sudo netplan apply # Verify IP ip addr show | grep "inet " Step 6: Enabling SSH for Remote Access SSH allows you to manage the server from your main computer. bash # Install SSH (if not already) sudo apt install openssh-server -y # Check SSH status sudo systemctl status ssh # Enable SSH on boot sudo systemctl enable ssh # Configure firewall to allow SSH sudo ufw allow ssh Generate SSH key on your client computer: bash # On your MacBook/laptop ssh-keygen -t ed25519 -C "your-email@example.com" ssh-copy-id m01@000.000.1.100 Now you can SSH into your server: bash ssh m01@000.000.1.100 Step 7: Basic Firewall Setup bash # Install UFW (Uncomplicated Firewall) sudo apt install ufw -y # Set defaults sudo ufw default deny incoming sudo ufw default allow outgoing # Allow essential services sudo ufw allow ssh sudo ufw allow http sudo ufw allow https # Enable firewall sudo ufw enable # Check status sudo ufw status verbose Step 8: Preventing Sleep When Lid is Closed Since this is a laptop, we need to keep it running even when the lid is closed. bash # Edit logind configuration sudo nano /etc/systemd/logind.conf Change these lines: text HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore bash # Restart the service sudo systemctl restart systemd-logind Note: The laptop will still generate heat with the lid closed. Ensure proper ventilation. Step 9: Fixing USB Ethernet Persistence USB Ethernet adapters can change names on reboot. Create a udev rule for consistency. bash # Get your MAC address ip link show | grep ether # Create udev rule sudo nano /etc/udev/rules.d/99-usb-ethernet.rules Add: text SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:e0:4c:68:00:f5", NAME="eth0" bash # Apply the rule sudo udevadm control --reload-rules sudo udevadm trigger # Update netplan to use eth0 sudo nano /etc/netplan/00-installer-config.yaml Now use eth0 instead of the dynamic enx... name. Next Steps Your server is now running with: ✅ Static IP address ✅ SSH access ✅ Firewall protection ✅ Will stay running with lid closed In Article 2, we'll install Kubernetes (K3s) and learn how to deploy containers at scale.