Generally, you would want to have a dedicated partition for swap however, a swap file can also be used. You can follow the steps below to create/increase your swap file on a cPanel server. Please note, you must have root access to perform this action. If you’re unsure if you need to do this, please either consult our support department (if you’re a VeeroTech customer) or your server administrator before performing these steps.
Creating the swap file via ssh:
Create a 2GB swap file using the command below:
dd if=/dev/zero of=/swapfile bs=1M count=2048
Make the swap
Activate the swap file:
Add an entry to the fstab to mount the swap file on boot:
Once inside of the editor for the fstab, enter the line below at the end of the file:
/swapfile swap swap defaults 0 0
Now, save/close the fstab file & reboot your server. Once rebooted, you should now see the new swap size.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?
If the steps above listed in this article do not resolve your issue, please feel free to open a support ticket and we’d be happy to take a look. Looking for better web hosting? Sign up today and take 50% off your first month with promo code: 1stmonth50
Our Guiding Principles
- Provide consistent, stable and reliable web hosting services.
- Ensure rapid ticket response and quick resolutions to issues.
- Never saturate or over-provision servers to ensure stability and speed for our customers.
- Use only high quality enterprise-class hardware to ensure minimal downtime from hardware failures.
- Provide clear pricing with no hidden fees or gotchas.