Skip to content
⚽ World Cup Predictions Predict Ecuador – Germany (25.06. 22:00) and secure up to 25% top-up bonus! Predict now

Wie richte ich einen Swap-Speicher unter Linux ein?

Linux

FAQ · Linux · Help & Support

21. Feb 2026 1 min

Swap-Speicher erweitert den verfügbaren Arbeitsspeicher deines Servers, indem Festplattenplatz als virtueller RAM genutzt wird. Das ist besonders nützlich auf Servern mit wenig RAM.

1. Aktuellen Swap prüfen:
sudo swapon --show
free -h

2. Swap-Datei erstellen (z.B. 2 GB):
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

3. Permanent machen:
Füge folgende Zeile in /etc/fstab ein:
/swapfile none swap sw 0 0

4. Swappiness anpassen (optional):
Standardmäßig ist der Wert 60. Für Server empfehlen wir einen niedrigeren Wert:
sudo sysctl vm.swappiness=10

Permanent in /etc/sysctl.conf:
vm.swappiness=10

Still have questions?

Our support team is happy to help - via ticket, email, or phone.