Increasing Swap prevents the server from crashing when memory spikes during builds. Run these commands via SSH on your VPS:
# Turn off existing swap
sudo swapoff -a
# Allocate a 4GB swap file
sudo fallocate -l 4G /swapfile
# Set correct permissions
sudo chmod 600 /swapfile
# Format and activate swap
sudo mkswap /swapfile
sudo swapon /swapfile
# See status
sudo swapon --show
# Verify the new swap size
free -h
Top comments (0)