Ultimate Guide to Setting Up a Home Server with Ubuntu
Building your own home server is rewarding — you'll learn Linux, save money on hosting fees, and have complete control over your data. Ubuntu Server is the perfect starting point: stable, well-documented, with a massive package ecosystem.
This comprehensive guide covers everything from hardware selection to running production-ready services.
Phase 1: Hardware Selection
CPU Options
| Use Case | Recommended CPU | Price Range |
|---|---|---|
| Basic home server | Intel Core i3-12100 / AMD Ryzen 3 3200G | $100-150 |
| Media server | Intel Core i5-12400 / AMD Ryzen 5 5600G | $150-220 |
| Multiple Docker containers | Intel Core i7-12700 / AMD Ryzen 7 5700G | $250-350 |
| Enthusiast / homelab | AMD Ryzen 9 5900X / Intel Core i9-12900K | $350-600 |
RAM Requirements
- 8GB: Minimum for Docker + 5-10 containers
- 16GB: Recommended for Docker + Plex + multiple services
- 32GB: Power users, many containers, VMs, large databases
- 64GB: Enthusiast level, virtualization, homelab
Recommendation: Start with 16GB DDR4-3200 or DDR5-4800. It's enough for most use cases and affordable.
Storage Strategy
| Storage Type | Speed | Use Case |
|---|---|---|
| NVMe SSD (OS) | 🏆 Fastest | Ubuntu installation, Docker images, databases |
| SATA SSD (Data) | Fast | Frequently accessed data, nextcloud config |
| HDD RAID (Media) | Slower, high capacity | Plex library, backups, archives |
Recommended setup: 250GB NVMe for OS + 2TB HDD in RAID for media/backups
Network Requirements
- 1Gbps Ethernet: Minimum for home server use
- 2.5Gbps/10Gbps: Recommended for media streaming
- WiFi: Avoid — use ethernet for stability
Phase 2: Ubuntu Installation
Download Ubuntu Server
# Download latest LTS (Long Term Support)
wget https://cdimage.ubuntu.com/releases/24.04.1/ubuntu-24.04.1-live-server-amd64.iso
# Flash to USB (on Mac):
# 1. Insert USB drive
# 2. Download Etcher from etcher.io
# 3. Flash ISO to USB
# 4. Boot server from USB
Installation Steps
- Boot from USB: Press F2/Del during startup for BIOS
- Select "Install Ubuntu": Not "Try"
- Choose language: English
- Installation type: "Ubuntu Server (minimized)"
- Partition: Use entire disk (LVM is default)
- Set user: Create your main user account
- SSH: Enable "Install OpenSSH server"
- Reboot: Remove USB and boot into new Ubuntu
Post-Installation Updates
# Connect via SSH (replace IP with your server IP)
ssh username@192.168.1.100
# Update system
sudo apt update
sudo apt upgrade -y
# Install essential tools
sudo apt install -y vim git curl wget htop unzip
Phase 3: Basic Security
Set Up SSH Key Authentication
# Generate SSH key on your main machine
ssh-keygen -t ed25519
# Copy key to server
ssh-copy-id username@192.168.1.100
# Test key login
ssh username@192.168.1.100
Disable Password SSH
# Edit SSH config
sudo vim /etc/ssh/sshd_config
# Change:
PasswordAuthentication no
PermitRootLogin no
# Restart SSH
sudo systemctl restart sshd
Configure Firewall (UFW)
# Install UFW
sudo apt install ufw -y
# Allow SSH
sudo ufw allow 22/tcp
# Allow common services (adjust for your needs)
sudo ufw allow 80/tcp # HTTP
sudo ufw allow 443/tcp # HTTPS
sudo ufw allow 32400/tcp # Plex
# Enable firewall
sudo ufw enable
sudo ufw status
Enable Auto Security Updates
# Install unattended-upgrades
sudo apt install unattended-upgrades -y
# Configure auto-updates
sudo dpkg-reconfigure -plow unattended-upgrades
# Review config: /etc/apt/apt.conf.d/50unattended-upgrades
Phase 4: Docker Installation
Install Docker Engine
# Add Docker's official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# Set up Docker repository
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add your user to docker group
sudo usermod -aG docker $USER
# Enable Docker on boot
sudo systemctl enable docker
sudo systemctl start docker
# Test installation
docker run hello-world
Install Docker Compose
# Docker Compose plugin is now bundled with Docker
# Verify installation
docker compose version
# If you need standalone:
sudo apt install -y docker-compose
Configure Docker User
Log out and back in for docker group to take effect, then verify:
docker run hello-world
Phase 5: Essential Services
Create Docker Compose Directory
mkdir -p ~/docker/compose
cd ~/docker/compose
Set Up Portainer (Docker Management)
cat > docker-compose.yml <
Set Up Watchtower (Auto-Update Containers)
# Add to docker-compose.yml
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
restart: always
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_INCLUDE_STOPPED=false
Phase 6: Reverse Proxy (Optional but Recommended)
Nginx Proxy Manager
# Add to docker-compose.yml
nginx_proxy_manager:
image: jc21/nginx-proxy-manager:latest
container_name: nginx_proxy_manager
restart: always
ports:
- 80:80
- 443:443
- 81:81
volumes:
- ./data/nginx_proxy_manager:/data
- ./data/letsencrypt:/etc/letsencrypt
environment:
- DB_SQLITE_FILE=/data/database.sqlite
# Add to docker-compose.yml
nginx_proxy_manager:
image: jc21/nginx-proxy-manager:latest
container_name: nginx_proxy_manager
restart: always
ports:
- 80:80
- 443:443
- 81:81
volumes:
- ./data/nginx_proxy_manager:/data
- ./data/letsencrypt:/etc/letsencrypt
environment:
- DB_SQLITE_FILE=/data/database.sqliteNginx Proxy Manager gives you:
- 🌐 Domain names: Access services via
plex.yourdomain.cominstead of IP - 🔒 Auto SSL: Let's Encrypt certificates for HTTPS
- 🛡️ Security headers: HTTPS-only, HSTS, etc.
Phase 7: Monitoring & Maintenance
Set Up System Monitoring
# Install Netdata (one command)
bash <(curl -Ss https://my-netdata.io/kickstart.sh)
# Access dashboard: http://your-server-ip:19999
Set Up Log Rotation
# Configure logrotate to prevent disk filling
sudo vim /etc/logrotate.d/docker
# Add:
/var/lib/docker/containers/*/*.log {
daily
rotate 7
compress
delaycompress
missingok
notifempty
create 644 root root
}
Phase 8: Backup Strategy
Automated Backups with Restic
# Install restic
curl -fsSL https://raw.githubusercontent.com/restic/restic/master/install.sh | bash
# Initialize repository
restic init --repo /backup/directory
# Backup important directories
restic backup /home --repo /backup/directory
# Schedule daily backups with cron
crontab -e
# Add:
0 2 * * * /path/to/restic backup /home --repo /backup/directory
Hardware Recommendations Summary
| Component | Recommended | Price Range |
|---|---|---|
| CPU | Ryzen 5 5600G / Intel i5-12400 | $150-220 |
| RAM | 16GB DDR4-3200 | $60-80 |
| OS Drive | 256GB NVMe SSD | $50-80 |
| Storage | 2x 4TB WD Red (RAID 1) | $180-220 |
| Power Supply | 80Plus Gold certified | $80-120 |
| Case | Mini ITX / Micro ATX | $50-100 |
Total: ~$550-800 for complete server (excludes HDDs for media)
Best Practices
- ✅ Use SSH keys: Disable password authentication
- ✅ Enable firewall: Only open necessary ports
- ✅ Keep system updated: Security patches
- ✅ Monitor resources: Netdata or Grafana
- ✅ Back up regularly: Test restore process
- ✅ Use RAID: Protect data from drive failure
- ✅ Document your setup: Document config files, IP addresses
Next Steps
After completing this guide, your home server is ready for:
- Deploying Docker containers from Docker templates
- Setting up media server (Plex, Jellyfin)
- Installing productivity tools (Nextcloud, OnlyOffice)
- Configuring remote access with VPN
- Building home automation (Home Assistant)
Conclusion
Building a home server with Ubuntu is a rewarding project that pays dividends in learning, savings on hosting, and control over your data. Start with this guide, adapt to your needs, and expand as you go.
Remember: The best home server is the one that fits your specific use case. Don't overspend on hardware you won't use — start modest and upgrade as needed.
Affiliate Disclosure: This article contains affiliate links to recommended hardware and services. If you purchase, I may earn a commission at no extra cost.