Skip to content

Adding Swapfile in Ubuntu / Debian

TL;DR

  • sudo fallocate -l 4G /swapfile
  • sudo chmod 600 /swapfile
  • sudo mkswap /swapfile 
  • sudo swapon /swapfile 
  • sudo swapon -s

In case you need to create a swapfile, see steps above.

Published inCode