Quick answer
How do you add swap on a VPS?
To add swap on a VPS, create a file with fallocate -l 1G /swapfile, set mode 600, run mkswap and swapon, then add a line to /etc/fstab so it returns after a reboot. JadeKVM Bead, with 1 GB of RAM, gains the most from 1 GB of swap; Pendant, with 3 GB, from 2 GB.
In brief
- A swap file needs no repartitioning and takes 5 commands.
- Size: 1 GB on Bead, 2 GB on Pendant; larger plans rarely need it.
- fstab line keeps it after a reboot.
- swappiness 10 makes the kernel use swap only under pressure.
How to add swap on a VPS in 5 steps?
Run the commands with sudo. Check first that swapon --show prints nothing.
Create the file
Run
sudo fallocate -l 1G /swapfile, or 2G on a 3 GB plan.Lock it down
Run
sudo chmod 600 /swapfileso no user can read memory pages.Format and enable
Run
sudo mkswap /swapfile, thensudo swapon /swapfile.Make it permanent
Add
/swapfile none swap sw 0 0to /etc/fstab.Tune swappiness
Set vm.swappiness=10 in /etc/sysctl.d and apply it.
How much swap should each plan get?
| Plan | RAM | Disk | Suggested swap |
|---|---|---|---|
| Bead | 1 GB | 20 GB NVMe | 1 GB |
| Pendant | 3 GB | 45 GB NVMe | 2 GB |
| Bangle | 4 GB | 80 GB NVMe | 1 to 2 GB, optional |
| Seal | 8 GB | 160 GB NVMe | Optional |
| Vessel | 16 GB | 200 GB NVMe | Rarely needed |
Why add swap on a small VPS?
Swap gives the kernel room to park idle pages, so a memory spike slows the server instead of killing a process. Without swap, the out-of-memory killer stops the largest process, often your database. A package upgrade or a Docker build can cause such a spike on 1 GB.
Swap is not extra RAM. Disk is far slower than memory, even NVMe. If the server swaps all day, it needs a larger plan, not more swap.
swapon --show
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
echo 'vm.swappiness=10' | sudo tee /etc/sysctl.d/90-swappiness.conf
sudo sysctl --system
free -hWhich swappiness is best on a VPS in 2026?
10 is a common choice for servers: swap stays idle until memory runs short. The kernel default is 60, which pushes idle pages out sooner. A lower value keeps active data in RAM. The kernel documentation explains the scale from 0 to 200.
Does swap fit the Bead and Pendant plans?
Yes: both have room on disk and gain the most from it. Bead offers 1 shared vCPU, 1 GB RAM, 20 GB NVMe, 1 TB a month. Pendant offers 1 shared vCPU, 3 GB RAM, 45 GB NVMe, 1 TB a month. According to JadeKVM's survey of 2 November 2026, comparable 1 GB plans at 12 no-KYC crypto hosts averaged $10.91 a month; Bead costs $3.75 on 12 months.
With swap, Bead can run a Telegram bot or a small Docker container. If you outgrow it, the 4 GB Asia VPS page shows the next step.
How do you check or remove swap later?
free -h and swapon --show show use; swapoff and the fstab line undo it. Run sudo swapoff /swapfile, delete the line from /etc/fstab, then remove the file. Watch vmstat 5 for the si and so columns: steady numbers above zero mean the plan is too small.
Can swap break anything on a KVM server?
No, on KVM the swap file is yours like any other file. JadeKVM servers run their own kernel, so swap behaves as on a physical machine. vCPU cores are shared with other servers on the same physical machine; RAM and NVMe space are reserved for each server. Keep at least a few GB of disk free after creating the file.
Questions about swap on a VPS
How much swap does a 1 GB VPS need?
1 GB is a good start. It absorbs spikes during upgrades or builds without filling a 20 GB disk.
Is a swap file as good as a swap partition?
On current kernels, yes. A file is easier to resize and needs no repartitioning.
Does swap wear out NVMe disks?
Light swap use is harmless. Heavy, constant swapping means the server needs more RAM.
Can I add swap on Ubuntu 24.04 without a reboot?
Yes. swapon enables it at once; the fstab line only matters for the next boot.
Which is better on a small VPS: swap or zram?
zram compresses pages in RAM and is fast, but uses CPU. A swap file is simpler and fine for occasional spikes.
Verdict
- A 1 GB swap file on Bead and 2 GB on Pendant, with swappiness 10, prevents most out-of-memory kills.
- Constant swapping is a sign to move up a plan, not to add more swap.
Sources (3)
- Swap, Ubuntu community help wiki — Ubuntu (read 2026-11-16)
- Swap, Debian Wiki — Debian (read 2026-11-16)
- Documentation for /proc/sys/vm (swappiness) — kernel.org (read 2026-11-16)
Start small and add swap
Bead offers 1 vCPU / 1 GB / 20 GB for $3.75 a month on 12 months.
- Built by a person, 1 hour at most after confirmation
- Lost days credited back if a server cannot be delivered
- Pay in BTC, XMR, USDT, USDC, ETH, SOL or LTC
- DomaineGoat LLC · Panama