Linux Swap File

You can add another Linux swap file to your VPS. This guide should work on most Linux distributions.Please note that the given paths may vary on your VPS. If you want to locate your file on a different path, you need to edit it.

  1. Create a 1GB file
fallocate -l 1G /data/newswapfile

If fallocate isn’t available you can use dd

dd if=/dev/zero of=/data/newswapfile bs=1024 count=1048576
  1. Edit permissions so that only root got accees to that file
chmod 600 /data/newswapfile
  1. To make the file a swap file use mkswap
mkswap /data/newswapfile
  1. Now enable the swap file
swapon /data/newswapfile
  1. You can verify it with
swapon --show
  1. Finally, make it permanent to persit after reboots. Add the following line to your /etc/fstab
/data/newswapfile swap swap defaults 0 0

Debian 11 Kernel

Debian 11 is shipped with Kernel 5.10. This Kernel seems to have some issues with virtual server environment. It happens to get errors upon rebooting the server. Only an immediate restart via the control panel seems to help in such a case.

We recommend using a higher Kernl from the backport repository. Here are the steps to install another Kernel version:

cp /etc/apt/sources.list /etc/apt/sources.list.bak
echo "deb bullseye-backports main" >> /etc/apt/sources.list
apt-get update
apt-cache search linux-image | grep bpo
apt-get install linux-image-5.16.0-0.bpo.4-amd64 linux-headers-5.16.0-0.bpo.4-amd64

In this example it will install Kernel 5.16 to your VPS. After installing the Kernel you need to reboot your VPS via the control panel once.