Bogdan Alexandru MilitaruFollowFeb 18, 2021·2 min readHow to add Swap memory on UbuntuCreate a file and preallocate size. In the following example we allocate 4GB$ sudo fallocate -l 4G /swapfileThe prompt will return:$ ls -lh /swapfile-rw-r--r-- 1 root root 4.0G Feb 8 08:50 /swapfileEnable SWAP file