Add swap on DO Ubuntu 16.04 https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04
#!/bin/bash
# create
fallocate -l 1G /swapfile
# verify
ls -lh /swapfile
# perm should be -rw-------
chmod 600 /swapfile
# create and enable
mkswap /swapfile
swapon /swapfile
# verify
swapon --show
free -h
# persist across reboot
cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab