A user (nineb) is seeking ways to run Discourse on a resource-constrained VPS with less than 2GB RAM and no swap, as they’ve already provisioned a non-upgradable 1-core, 2GB RAM instance. They’ve tried a workaround to temporarily create swap during installation but are unsure if it will work. Other users (pfaffman, itsbhanusharma, Ed_S) advise against this approach, emphasizing the importance of swap and suggesting alternatives like increasing resources, never updating, or migrating data. pfaffman mentions the possibility of building the image on another machine, but acknowledges the complexity. itsbhanusharma clarifies that the key takeaway is the advice against circumventing the swap requirement, while the suggestion to contact the cloud provider was merely an optional path forward.
You probably can’t build a container without swap. You could try creating the swap, building the container, shutting down the container, and removing the swap.
You’re really on your own with this. I would advise highly against trying to circumvent the SWAP requirement. You should contact your cloud provider to provision a larger disk for you.
I tried the next best thing with two SSH windows. create swap, run launcher, other ssh window delete swap, launcher continued. And this might work on a better provisioned VPS. On my next spare I will try it. I have an instance now running on 4c12r
Typically you need more memory (RAM+swap) for an update than you do for normal service.
If you have no space for swap, it’s because your forum data (database+uploads) is using the space you need.
It’s just possible that you could follow the strategy
never update
or the strategy
migrate your data each time to a fresh up to date installation
But I’ve done my own struggling with a minimal sized instance, using my many decades of sysadmin experience. Eventually, it was preferable to use a bigger machine. In fact, very preferable, because the bigger machine was cheaper. This is because different providers charge different amounts - I moved from Digital Ocean to Hetzner.
The other possibility, which would require a bunch of work, would be to build the new image on another machine, put it to some repo, and then launch it on the low-resource machine.
But that’s beyond the kind of help it’s feasible to provide on a forum.