One of the most common questions new self-hosters ask is: “How much RAM do I actually need?” The answer depends on what you’re running, but this guide will help you figure out exactly what you need—without overspending or underprovisioning.
The Quick Answer
| Use Case | Minimum RAM | Recommended |
|---|---|---|
| Pi-hole only | 1GB | 2GB |
| Light Docker (3-5 containers) | 4GB | 8GB |
| Medium Docker (10-15 containers) | 8GB | 16GB |
| Heavy Docker + databases | 16GB | 32GB |
| Virtualization (Proxmox) | 16GB | 32-64GB |
| Everything + room to grow | 32GB | 64GB |
Now let’s dive into the details.
Understanding RAM Usage in Home Servers
How Linux Uses RAM
Before we discuss requirements, understand that Linux handles RAM differently than Windows. Linux aggressively caches files in unused RAM, which means:
- “Used” RAM isn’t always truly used
- High RAM usage isn’t necessarily bad
- The
freecommand can be misleading
The key metric is available RAM, not free RAM. Use free -h and look at the “available” column:
$ free -h
total used free shared buff/cache available
Mem: 31Gi 12Gi 1.2Gi 892Mi 18Gi 17Gi
In this example, only 1.2GB is “free,” but 17GB is actually available for applications.
What Consumes RAM?
On a typical home server:
- Operating System: 500MB - 2GB base
- Docker daemon: ~100MB overhead
- Each container: Varies wildly (50MB to several GB)
- Databases: Often the biggest consumers
- File caching: Uses “spare” RAM (good thing)
- Virtual machines: Reserved RAM per VM
RAM Requirements by Service
Let’s look at real-world RAM usage for popular self-hosted services.
Lightweight Services (50-200MB each)
These services sip RAM and run well on minimal hardware:
| Service | Typical RAM | Notes |
|---|---|---|
| Pi-hole | 50-100MB | DNS queries are tiny |
| AdGuard Home | 100-150MB | Slightly more than Pi-hole |
| WireGuard | 20-50MB | Minimal overhead |
| Nginx/Caddy | 50-100MB | Reverse proxy |
| Traefik | 100-150MB | More features = more RAM |
| Uptime Kuma | 100-150MB | Monitoring dashboard |
| Homepage | 50-100MB | Dashboard |
| Vaultwarden | 50-100MB | Password manager |
Medium Services (200MB-1GB each)
These need more resources but are still reasonable:
| Service | Typical RAM | Notes |
|---|---|---|
| Home Assistant | 300-800MB | Depends on integrations |
| Nextcloud | 300-500MB | Without caching |
| Jellyfin (idle) | 200-400MB | More during transcoding |
| Plex (idle) | 200-400MB | More during transcoding |
| Gitea | 200-400MB | Lightweight Git server |
| Paperless-ngx | 400-800MB | Document management |
| Immich | 500MB-1GB | Photo management |
Heavy Services (1GB+ each)
These are the RAM hogs—plan accordingly:
| Service | Typical RAM | Notes |
|---|---|---|
| PostgreSQL | 500MB-4GB | Depends on configuration |
| MariaDB/MySQL | 500MB-2GB | Depends on databases |
| Elasticsearch | 2-8GB | Minimum 2GB heap |
| Plex (transcoding) | 1-4GB | Per stream |
| Jellyfin (transcoding) | 1-3GB | Per stream |
| GitLab | 4-8GB | Very heavy |
| Discourse | 2-3GB | Forum software |
| Mastodon | 2-4GB | Social media server |
Real-World Server Configurations
Let’s look at practical examples with actual RAM usage.
Example 1: Basic Home Server (8GB)
A minimal but useful setup:
Verdict: 8GB is perfect for this setup.
Example 2: Media Server (16GB)
A home media setup:
Verdict: 16GB is ideal; 8GB would work but feel tight.
Example 3: Power User (32GB)
Running everything:
Verdict: 32GB provides comfortable margins for growth.
Example 4: Virtualization Host (64GB)
Running Proxmox with multiple VMs:
Verdict: 64GB allows serious virtualization.
Factors That Increase RAM Needs
1. Database Size and Queries
Databases benefit enormously from RAM:
- Small database (<1GB): Default settings fine
- Medium database (1-10GB): Allocate 2-4GB to database
- Large database (10GB+): Consider 8GB+ for database alone
PostgreSQL and MariaDB can be tuned to use more RAM for better performance.
2. Number of Users
More simultaneous users = more RAM:
- 1-2 users: Baseline requirements
- 3-5 users: Add 25-50% buffer
- 5-10 users: Consider doubling estimates
- 10+ users: Size for concurrent peak usage
3. Transcoding
Media transcoding is RAM-intensive:
- Direct play: Minimal RAM
- 1 transcode stream: +1-2GB
- Multiple transcodes: +1-2GB per stream
- 4K transcoding: +2-4GB per stream
Use hardware transcoding (Intel Quick Sync) to reduce RAM pressure.
4. Search and Indexing
Full-text search engines need RAM:
- Basic search: SQLite FTS is lightweight
- Elasticsearch/Meilisearch: 2-8GB depending on index size
- Immich ML models: 1-2GB for photo recognition
5. Machine Learning
AI/ML features in self-hosted apps:
- Immich ML: 1-2GB
- Frigate object detection: 1-2GB (or use Coral TPU)
- Local LLMs: 4-16GB+ depending on model
- Whisper transcription: 1-4GB
How to Monitor RAM Usage
Command Line Tools
Check current usage:
# Overview
free -h
# Per-process usage
ps aux --sort=-%mem | head -20
# Live monitoring
htop
Docker-Specific
# All container stats
docker stats
# Specific container
docker stats container_name
Monitoring Stacks
For ongoing monitoring, deploy:
- Netdata: Real-time, minimal setup
- Prometheus + Grafana: Comprehensive but complex
- Glances: Simple web-based monitoring
Upgrade Strategies
When to Upgrade
Consider adding RAM when:
- Available RAM frequently drops below 1-2GB
- You’re hitting swap regularly
- Services are being OOM-killed
- Performance degrades under load
Cost-Effective Approaches
- Start modest, upgrade later: 8GB → 16GB is cheap
- Buy matched pairs: Better performance, easier upgrades
- Check compatibility: DDR4 vs DDR5, speeds, slots
- Consider used/refurbished: Server RAM is often cheaper used
ECC vs Non-ECC
For home servers:
- Non-ECC: Fine for most use cases, cheaper
- ECC: Recommended for ZFS, critical data, 24/7 operation
- Many mini PCs: Don’t support ECC (check specs)
Swap Space
Should You Use Swap?
Yes, but as a safety net, not primary memory:
- SSD swap: Acceptable for occasional use
- HDD swap: Very slow, avoid if possible
- No swap: Risk of OOM crashes
Recommended Swap Size
| RAM | Swap Size |
|---|---|
| 4GB | 4GB |
| 8GB | 4-8GB |
| 16GB | 4-8GB |
| 32GB+ | 4-8GB |
With ample RAM, large swap is unnecessary.
My Recommendations
Budget Build: 8GB
Best for:
- Learning self-hosting
- Running 5-10 lightweight containers
- Single-user setups
- Pi-hole + basic services
Skip if: You want media transcoding or databases.
Sweet Spot: 16GB
Best for:
- Most home users
- Media servers with transcoding
- 10-20 containers
- Small databases
- Room to experiment
This covers 90% of home server use cases.
Future-Proof: 32GB
Best for:
- Power users
- Running “everything”
- Multiple databases
- Photo management (Immich)
- Comfortable headroom
You’ll rarely feel constrained.
Virtualization: 64GB
Best for:
- Running Proxmox/ESXi
- Multiple VMs
- Lab environments
- Running VMs + containers
Allows serious experimentation.
Common Mistakes
1. Over-Provisioning
32GB for Pi-hole is wasteful. Start smaller and upgrade if needed.
2. Under-Provisioning
4GB for Nextcloud + Plex + databases will struggle. Be realistic about needs.
3. Ignoring Swap
No swap means OOM killer will terminate services randomly. Always have some swap.
4. Not Monitoring
You can’t optimize what you don’t measure. Set up basic monitoring early.
Conclusion
For most self-hosters, 16GB is the sweet spot—enough for media servers, databases, and a dozen containers without stress. Start there if you’re unsure.
If you’re just beginning with Pi-hole and a few services, 8GB works fine. If you’re planning heavy virtualization or want to run everything, 32GB gives comfortable headroom.
Remember: RAM is one of the easiest upgrades. Start modest, monitor your usage, and upgrade when—not before—you need it.
Related guides: