How to enable SWAP on Ubuntu 20.04

root@tokyo:~# apt-get install -y dphys-swapfile

After that /etc/dphys-swapfile needs to be edited:

root@tokyo:~# vi /etc/dphys-swapfile

Here you can make various settings but for now let’s just use double the size of the RAM for the SWAP that should be created by changing




Close and save /etc/dphys-swapfile and restart dphys-swapfile.

root@tokyo:~# /etc/init.d/dphys-swapfile restart

If you run

root@tokyo:~# top

you now can see your SWAP.

Leave a Reply

Your email address will not be published. Required fields are marked *