User abdurrehman encountered an error while running ./discourse-setup, which failed to create a required 2GB swapfile due to permission and mounting issues. The error suggests the VPS may not be running on KVM virtualization — a requirement for swap creation — and Falco advised checking with the provider, Atlantic.net, to confirm if the plan uses KVM or OpenVZ. Falco noted that free VPS offerings are unlikely to be KVM-based. Timelord shared a manual swap creation guide, but Falco clarified that discourse-setup should handle it automatically — though Timelord reported past failures on Ubuntu instances from providers like Ramnode. abdurrehman confirmed they manually created the swapfile and completed the installation successfully. Later, abdurrehman asked if the swapfile could be removed post-install, to which Falco and Timelord strongly advised against removal, warning of potential system instability. pfaffman questioned whether the VPS permits swap creation at all, and abdurrehman confirmed they were able to create it manually and the install succeeded. The consensus is: if your VPS supports swap, keep it — it’s essential for Discourse stability.
I’m following the official install guide, and when I run this command.
./discourse-setup
I’m getting this error message.
root@server:/var/discourse# ./discourse-setup
WARNING: Discourse requires at least 2GB of swap when running with 2GB of RAM
or less. This system does not appear to have sufficient swap space.
Without sufficient swap space, your site may not work properly, and future
upgrades of Discourse may not complete successfully.
Ctrl+C to exit or wait 5 seconds to have a 2GB swapfile created.
install: cannot remove '/swapfile': Operation not permitted
fallocate: fallocate failed: Text file busy
mkswap: error: /swapfile is mounted; will not make swapspace
swapon: /swapfile: swapon failed: Device or resource busy
/swapfile swap swap auto 0 0
vm.swappiness = 10
Failed to create swap: are you root? Are you running on real hardware, or a fully virtualized server?
I have VPS of 2GB RM and 50 GB SSD and did set up a sub-domain for discourse as well.
Well, if I had to guess I would bet on it not being KVM as it’s simply more expensive. But I guess it doesn’t hurt asking their team, as their FAQs don’t mention the virtualization technology at all.