Run the following as root
$ dd if=/dev/zero of=/swapfile bs=1M count=[swap_size] # swap_size = 1024 for 1GB
$ chmod -R 0600 /swapfile
$ mkswap /swapfile
$ swapon /swapfile
Add the swap to your fstab
. To do so edit /etc/fstab
and add the following line