Enable Swap on AWS Linux machines

We run a bunch of machines on Amazon, and many of them are the t3.nano or micro instances, which don’t come out of the box with swap enabled, which is a weeeee bit of a pain if you run a webserver, as the 1GB memory be a low limit for Wordpress :slight_smile:

I have a tool that runs a bash script with the following code:

    SWAPFILE=/mnt/swapfile.swap
    dd if=/dev/zero of=$SWAPFILE bs=1M count=512
    mkswap $SWAPFILE
    chmod 600 /mnt/swapfile.swap
    swapon $SWAPFILE

    echo "swapon /mnt/swapfile.swap" >> /etc/rc.local
    chmod +x /etc/rc.d/rc.local

Getting SimpleHelp on the linux instance in the first place, well that’s a different ball game :slight_smile:

1 Like