No space left on your Cloud9 environment? Here's how to solve that
While using Cloud9, and installing node dependencies, my instance ran out of space. I couldn't finish setting up my project, and the terminal's autocompletion was dead in the water.
Personally, I don't like setting up my clients projects on my machine. They often require different versions of different tools, most of which I'd rather not have. And they take up valuable space.
So how do we solve that? I thought about using different user accounts. I've found it's a good way to have all the different browser tabs segregated by client or project. Much better than a browser window for each (which quickly eats up memory and becomes a mess). But some tools are installed globally, it's slow to setup on a mac, and it takes up some space.
Next, I thought about using a VM. Those are slower than the actual machine, but why not? One machine per client or project. Each cleanly, perfectly and absolutely separated in it's own little window. Nice. Except for the space. A full OS install each.
At some point I created a second macOS install, just for work, but realized that was actually worse than VMs.
Now... if only I could get rid of the space problem... Oh, how about setting up the VM on someone else's machine? That's how I ended up using Cloud9. Not perfect. Can't make iOS apps with it. But at least I can rid my machine of of my clients' web projects. Awesome!
Until I started installing all their node modules on it and ran into
No space left on device. Dammit. The terminal's autocompletion wouldn't even work anymore. What was that?
Cloud9 instances rely on AWS EBS volumes for storage, and the default one is moderately small (10GiB). It appears installing a 'few' dependencies (28 dev dependencies & 8 'regular' ones) fills it up pretty quickly. Especially given node's habit of bringing in thousands of packages, and their grandmothers, when you ask for one or two. But that's another story.
I needed more space.
So thank you Richard for your kind StackOverflow answer linking to the exact AWS Documentation page I needed, that somehow didn't pop up in the Google results (the following is a shameless paraphasing of said documentation page, mostly intended for my future self).
Basically, we need to resize our EBS volume.
For that, we create a
.sh file at the root of our environment (ie
Then we edit it and write this script, kindly provided by AWS, into it:
And, finally, we make it executable and run it with the desired new size for our EBS volume! (in my case, 15GiB)
And that's all! Hope it can help some other poor soul out there the way it helped me.
For now, I have stopped using Cloud9 as a development environment, mostly because of some CORS and Docker issues, but I'm pretty sure those can be ascribed to my inexperience with frontend development and containers.