Thanks for updating - unfortunately, it keeps saying permission denied on the last step.
ubuntu@i:~$ sudo echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
-bash: /etc/fstab: Permission denied
ubuntu@ip-172-26-3-111:~$ free
total used free shared buff/cache available
Mem: 498380 40512 269172 1848 188696 425816
Swap: 0 0 0
This is because you did the swapoff /var/swap.img command
just do
swapon /var/swap.img
then
echo "/var/swap.img none swap sw 0 0" >> /etc/fstab
then (to see if it's working)
free
I didn't put the swapoff in the PDF guide (was just for info on how to turn off)