Create a swap file executing the following script.

If you want to automount the swap file on boot, add to /etc/fstab /swapfile swap swap defaults 0 0

Tags:#linux#swap