-
Create a file:
fallocate -l 2G /swapfile
-
Secure it:
chmod 600 /swapfile
-
Format:
mkswap /swapfile
-
Enable:
swapon /swapfile
-
Make permanent: Add
/swapfile none swap sw 0 0
to/etc/fstab
-
Verify:
swapon --show
Most Popular Articles
How to Install and Configure a LAMP Stack on Your Linux VPS
For CentOS/Ubuntu: Run: sudo apt install apache2 mysql-server php php-mysql (Ubuntu) or yum...
How to Set Up Email Services on Your VPS
Install Postfix (Linux) or MailEnable (Windows). Set DNS records (MX, SPF, DKIM, DMARC)....
How to Schedule Automatic Backups on Your VPS
Use rsync and cron jobs.
How to Install and Configure cPanel on Your Linux VPS
Ensure your VPS is running a supported OS (CentOS, AlmaLinux, RockyLinux). Run: yum...
How to Harden SSH Security on Your Linux VPS
Edit the SSH config file: nano /etc/ssh/sshd_config Change the default port from 22 to...