Create Swap File:
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
Make Swap File Permanent:
sudo nano /etc/fstab
Add to the end:
/swapfile none swap sw 0 0
Removing a Swap File:
sudo vi /etc/fstab
Remove from the end:
/swapfile none swap sw 0 0
(line aforementioned may vary on configuration)