AWS + Azure Swap Space

Allocating swap space to a vanilla ubuntu server on Azure or AWS.

By default, you will have zero swap. Possibly resulting is unknown app/memory related crashes. Add a bit of swap for a buffer!

fallocate -l 1G /swapfile;
chmod 600 /swapfile;
mkswap /swapfile;
swapon /swapfile;
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab;
swapon --show;
free -h;