Watercooling My Raspberry Pi 5
Introduction
Running a Raspberry Pi 5 as the brain of a self‑hosted homelab is a common pattern for DevOps engineers who need a low‑cost, low‑power compute node for tasks such as DNS caching, CI runners, or edge monitoring. The Pi 5 brings a quad‑core Cortex‑A76 CPU, up to 8 GB of LPDDR4X RAM, and a 2 GHz boost clock that can sustain heavy workloads for extended periods.
In a typical rack‑mount or bookshelf setup, the Pi is often cooled with a passive heatsink and a small fan. That works for light loads, but when you push the device—running Docker containers, compiling code, or streaming video—the silicon can quickly approach its thermal throttling threshold (≈ 85 °C). Thermal throttling reduces clock speed, introduces latency, and can destabilize long‑running pipelines.
Enter water‑cooling. While it may sound like a novelty reserved for high‑end gaming rigs, a properly designed liquid‑cooling loop can keep the Pi 5 well below 50 °C even under sustained 100 % CPU load. For a DevOps professional, this translates into:
- Predictable performance – no surprise throttling during CI builds.
- Extended hardware lifespan – lower junction temperatures reduce electromigration.
- Quiet operation – replace noisy fans with a pump that runs at a few hundred RPM.
This guide walks you through the entire process of water‑cooling a Raspberry Pi 5 for production‑grade homelab use. We’ll cover the theory behind liquid cooling, the hardware you need, step‑by‑step assembly, configuration of temperature monitoring, and best‑practice optimizations for a reliable, self‑hosted infrastructure. By the end, you’ll have a repeatable workflow that can be scripted and version‑controlled, fitting naturally into a DevOps automation pipeline.
Understanding the Topic
What Is Water‑Cooling?
Water‑cooling (or liquid cooling) is a heat‑transfer technique that moves thermal energy from a hot component to a cooler fluid—typically distilled water mixed with a corrosion inhibitor. The fluid circulates through a cold plate attached to the heat source, then through a radiator where a fan dissipates the heat to ambient air. A pump maintains flow, and optional reservoirs provide fluid volume and a place for air bubbles to escape.
In the context of a Raspberry Pi 5, the cold plate replaces the traditional metal heat sink. The Pi’s System‑on‑Chip (SoC) and voltage regulator die are directly coupled to the plate via a thin thermal interface material (TIM). Because water has a thermal conductivity (~0.6 W/m·K) far higher than air (~0.025 W/m·K), the temperature gradient across the plate is dramatically reduced.
History and Development
Liquid cooling has been used in mainframes and high‑performance computing since the 1960s, but the hobbyist market exploded with the advent of all‑in‑one CPU water blocks for desktop PCs in the early 2000s. The Raspberry Pi community adopted the technique later, initially with custom‑machined copper blocks for the Pi 3 and Pi 4. The Pi 5’s larger PCB and higher power envelope prompted manufacturers to release purpose‑built water‑cooling kits in 2023, featuring CNC‑machined copper cold plates and 3‑mm ID tubing that fits the board’s limited clearance.
Key Features and Capabilities
| Feature | Description | Impact on Pi 5 |
|---|---|---|
| Cold Plate Material | CNC‑machined copper (≥ 99.9 % purity) | Maximizes heat spread, low thermal resistance |
| Tubing Size | 3 mm ID / 6 mm OD PTFE or silicone | Fits tight board spacing, low flow restriction |
| Pump Type | Low‑profile DC brushless (≈ 12 V, 120 mA) | Quiet, sufficient for ~0.5 L/min flow |
| Radiator | 120 mm × 60 mm × 25 mm aluminum fin stack | Compact, fits in a 1U rack or shelf |
| Coolant | Distilled water + 10 % propylene glycol | Prevents corrosion, safe for electronics |
| Temperature Sensors | DS18B20 digital sensor (optional) | Enables software throttling alerts |
Pros and Cons
| Pros | Cons |
|---|---|
| Superior thermal performance – ΔT ≈ 10 °C vs. air cooling ΔT ≈ 30 °C | Initial cost – cold plate, pump, radiator, coolant |
| Reduced acoustic noise – pump < 20 dB | Complexity – risk of leaks if not assembled correctly |
| Scalable – can add multiple Pi nodes to a single loop | Maintenance – periodic coolant replacement, bleed air |
| Aesthetic – clean look for showcase homelabs | Space constraints – requires room for tubing and radiator |
Use Cases and Scenarios
- CI/CD runners – Docker‑in‑Docker builds that max out the CPU for minutes at a time.
- Edge AI inference – Running TensorFlow Lite models on the Pi’s GPU while maintaining low latency.
- Media transcoding – 4K video encoding with hardware acceleration, which generates sustained heat.
- High‑availability clusters – Multiple Pi nodes in a Kubernetes “k3s” cluster where node stability is critical.
Current State and Future Trends
As of 2024, most water‑cooling kits for the Pi 5 are open‑source hardware designs shared on GitHub, allowing users to 3‑D print mounting brackets or CNC‑mill custom plates. The community is experimenting with micro‑loop designs that eliminate the reservoir, relying on a sealed loop with a high‑flow pump. Future trends include integrated temperature‑aware pump control (PWM‑driven pumps that speed up when the Pi exceeds a threshold) and IoT‑enabled coolant monitoring (pH, conductivity sensors) to pre‑empt corrosion.
Comparison to Alternatives
| Cooling Method | Typical ΔT (°C) | Noise (dB) | Cost (USD) | Maintenance |
|---|---|---|---|---|
| Passive heatsink | 30–35 | < 10 | 5–15 | None |
| Active fan + heatsink | 15–20 | 20–30 | 10–25 | Fan replacement |
| Peltier (TEC) + fan | 5–10 | 30–40 | 30–50 | Power consumption, condensation risk |
| Water‑cooling | 5–10 | < 20 | 45–80 | Coolant change, leak checks |
While a Peltier can achieve lower temperatures, its inefficiency and condensation risk make it unsuitable for unattended homelab nodes. Water‑cooling offers the best balance of performance, reliability, and noise for continuous operation.
Prerequisites
Hardware Requirements
| Item | Recommended Model | Reason |
|---|---|---|
| Raspberry Pi 5 | 8 GB model | Maximizes compute headroom |
| Water‑cooling kit | CNC‑machined copper cold plate + 120 mm radiator | Fits Pi 5 PCB layout |
| Pump | 12 V DC brushless (e.g., EK‑XC 400) | Low power, quiet |
| Tubing | 3 mm ID PTFE, 6 mm OD | Flexible, chemical‑resistant |
| Reservoir (optional) | 100 ml acrylic | Simplifies bleed |
| Coolant | Distilled water + 10 % propylene glycol | Prevents corrosion |
| Temperature sensor | DS18B20 waterproof probe | Software monitoring |
| Power supply | 5 V 3 A USB‑C (Pi) + 12 V 1 A (pump) | Stable rails |
Software Requirements
| Software | Minimum Version |
|---|---|
| Raspberry Pi OS (64‑bit) | 2023‑05‑03 |
vcgencmd (included) | N/A |
lm-sensors | 3.6.0 |
systemd | 247 |
docker (optional for monitoring) | 24.0.5 |
python3 | 3.11 |
pip | 23.2 |
psutil (Python library) | 5.9.5 |
Network & Security Considerations
- Isolated management VLAN – Keep the Pi’s SSH and monitoring ports on a dedicated VLAN to reduce exposure.
- SSH key authentication – Disable password login (
PasswordAuthentication no). - Firewall – Use
ufwto allow only required ports (e.g., 22, 2375 for Docker API if needed). - Rootless Docker – Run containers without root privileges to limit impact of a compromised container.
User Permissions
- Add the
piuser to thedockergroup (sudo usermod -aG docker pi). - Ensure the user running the pump control script has write access to
/sys/class/gpio(or usesudowith a limitedsudoersrule).
Pre‑Installation Checklist
- Verify Pi 5 firmware is up‑to‑date (
sudo rpi-eeprom-update). - Confirm the case can accommodate tubing and radiator.
- Inspect all tubing for cracks; replace if any.
- Prepare a clean, static‑free workspace.
- Gather tools: torque screwdriver, thermal paste, zip‑ties, leak‑test container.
Installation & Setup
1. Prepare the Raspberry Pi 5
1
2
3
4
# Update OS and firmware
sudo apt update && sudo apt full-upgrade -y
sudo rpi-eeprom-update -d -a
sudo reboot
After reboot, enable the I²C bus (required for DS18B20) and the vcgencmd temperature interface:
1
2
3
sudo raspi-config
# → Interface Options → I2C → Enable
# → Advanced Options → Enable VCGENCMD → Yes
2. Install Required Packages
1
2
sudo apt install -y lm-sensors python3-pip git
pip3 install psutil
3. Assemble the Water‑Cooling Loop
- Apply Thermal Interface Material (TIM) – Use a pea‑size amount of high‑performance thermal paste (e.g., Arctic MX‑4) on the SoC and VRM.
- Mount the Cold Plate – Align the plate’s mounting holes with the Pi’s standoff locations. Tighten screws to 0.5 Nm torque to avoid PCB warping.
- Connect Tubing – Cut two 10 cm lengths of 3 mm ID tubing. Push one end onto the cold plate inlet/outlet ports until a snug fit is achieved. Secure with zip‑ties.
- Install Pump & Reservoir – Place the pump in a 12 V powered enclosure. Connect the pump’s inlet to the radiator outlet and outlet to the cold plate inlet. If using a reservoir, insert it between the pump and radiator to aid bleed.
- Radiator Placement – Mount the 120 mm radiator on a vertical surface with a 12 V PWM fan (e.g., Noctua NF‑F12) blowing air through the fins.
4. Fill and Leak‑Test the Loop
- Fill the reservoir with the coolant mixture.
- Power the pump without connecting the Pi to verify flow (you should feel a slight vibration).
- Run the pump for 10 minutes while checking for leaks at every connection. Use a paper towel to detect moisture.
If any leak is found, shut down power, tighten the offending zip‑tie, and repeat the test.
5. Power Integration
Create a simple Power‑Distribution Board (PDB) using a 12 V‑to‑5 V buck converter (e.g., LM2596) to feed the Pi from the same 12 V source that powers the pump. This reduces cable clutter.
1
2
3
4
# Example wiring diagram (text description)
# 12V PSU --> Pump (direct)
# 12V PSU --> Buck Converter --> Pi 5 USB‑C Power Input
# Ground lines common across pump, Pi, and buck converter
6. Verify Temperature Reduction
After the system is fully assembled, boot the Pi and run a stress test:
1
2
3
4
5
# Install stress-ng
sudo apt install -y stress-ng
# Run a 5‑minute CPU stress on all cores
stress-ng --cpu 4 --timeout 300s
While the test runs, monitor temperature:
1
watch -n 1 vcgencmd measure_temp
You should see a stable temperature below 55 °C after the first minute, compared to > 80 °C with a stock fan.
7. Optional: Docker‑Based Monitoring Service
Deploy a lightweight container that publishes the Pi’s temperature via a Prometheus endpoint.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# docker-compose.yml
version: "3.8"
services:
pi-temp-exporter:
image: ghcr.io/prometheus/node-exporter:latest
container_name: pi-temp-exporter
restart: unless-stopped
privileged: true
command:
- --collector.textfile.directory=/run/prometheus
volumes:
- /run/prometheus:/run/prometheus
networks:
- monitoring
networks:
monitoring:
driver: bridge
Create a script that writes the temperature to a textfile collector:
1
2
3
4
#!/usr/bin/env bash
# /usr/local/bin/pi_temp_collect.sh
TEMP=$(vcgencmd measure_temp | cut -d= -f2)
echo "pi_temperature_celsius $TEMP" > /run/prometheus/pi_temp.prom
Add a systemd timer to run the script every 15 seconds:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# /etc/systemd/system/pi-temp-collector.service
[Unit]
Description=Collect Raspberry Pi temperature for Prometheus
[Service]
Type=oneshot
ExecStart=/usr/local/bin/pi_temp_collect.sh
# /etc/systemd/system/pi-temp-collector.timer
[Unit]
Description=Run Pi temperature collector every 15 seconds
[Timer]
OnBootSec=10sec
OnUnitActiveSec=15sec
Unit=pi-temp-collector.service
[Install]
WantedBy=timers.target
Enable the timer:
1
2
sudo systemctl daemon-reload
sudo systemctl enable --now pi-temp-collector.timer
Now the node-exporter container will expose pi_temperature_celsius for Grafana dashboards or alerting rules.
Configuration & Optimization
1. Fine‑Tuning the Pump Speed
Most low‑profile pumps support PWM control on the power line. Connect the pump’s PWM pin to a Raspberry Pi GPIO (e.g., GPIO 18) and use pigpio to adjust speed based on temperature.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# pump_control.py
import pigpio
import subprocess
import time
PWM_PIN = 18
MIN_DUTY = 30 # 30 % duty cycle
MAX_DUTY = 100 # 100 % duty cycle
TARGET_TEMP = 45.0 # °C
pi = pigpio.pi()
pi.set_mode(PWM_PIN, pigpio.OUTPUT)
def get_temp():
out = subprocess.check_output(['vcgencmd', 'measure_temp']).decode()
return float(out.split('=')[1].replace("'C", ""))
while True:
temp = get_temp()
duty = MIN_DUTY + (temp - 30) * (MAX_DUTY - MIN_DUTY) / (TARGET_TEMP - 30)
duty = max(MIN_DUTY, min(MAX_DUTY, duty))
pi.set_PWM_dutycycle(PWM_PIN, int(duty))
time.sleep(5)
Run the script as a systemd service to ensure it starts on boot.
1
2
3
4
5
6
7
8
9
10
11
12
# /etc/systemd/system/pump-control.service
[Unit]
Description=Dynamic pump speed controller for Pi water‑cooling
After=network.target
[Service]
ExecStart=/usr/bin/python3 /opt/pump_control.py
Restart=on-failure
User=pi
[Install]
WantedBy=multi-user.target
1
sudo systemctl enable --now pump-control.service
2. Security Hardening
- Limit GPIO access – Add the `