Run as ROOT
Copy this code & paste in your vps terminal
sudo apt install -y wget && sudo wget -q https://raw.githubusercontent.com/callmejasman/swapfile/main/swapfile.sh && sudo chmod +x swapfile.sh && ./swapfile.sh
Script will ask for Swap Capacity, set them correct number e.g. 1 for 1 gigabyte swapfile.
Server will reboot automatically