Cloud9 WebIDE - self-hosted in 2 easy steps

Tags: #<Tag:0x00007f76faccbb90> #<Tag:0x00007f76faccba00> #<Tag:0x00007f76faccb8c0> #<Tag:0x00007f76faccb780>

More practical than expected

HTML5 is the new VT100

At least for me my personally hosted Cloud9 has become my web-multiplexed go-to terminal application. Take a short look at it:

I use ZSH in the websocket terminals, with syntax highlighting and completion plugins. This comes in handy for mobile usage.

The theme, font etc. are customize-able. You can download the source, and edit the CSS if you think that is required. Cloud9 can be hosted in your own container / VM, since it’s only a simple node.js app.
The web terminal works with (n)curses applications, and I have tested it in Firefox and Chrome. I don’t really care about IE or other exotic browsers. There are mobile apps for Cloud9, in case you have a larger tablet or “mobile phone”.

Install Cloud9 on a Debian based Linux distribution

As a user of your choice, run the following commands:

sudo apt-get install nodejs
git clone https://github.com/c9/core sdk
cd sdk
./scripts/install-sdk.sh

Now that was easy, wasn’t it?

Start it - with supervisord

% cat /etc/supervisor/conf.d/cloud9.conf 
[program:cloud9]
command=/usr/bin/nodejs /home/wishi/c9sdk/server.js --listen 192.168.100.999  -w /home/wishi/workspace -a user:iamsosmart
user=wishi
directory=/home/wishi
autostart=true
autorestart=true
startretries=3
stderr_logfile=/var/log/cloud9/cloud9.err.log
stdout_logfile=/var/log/cloud9/cloud9.out.log

Restart with service supervisor restart and make sure you setup Logrotate:

% cat /etc/logrotate.d/cloud9.conf 
/var/log/cloud/*.log 
{
    rotate 3
    missingok
    nocompress
    create
    sharedscripts
}

The fact that the Basic Auth credentials will be in the process list obviously sucks. There is a way to embed the startup parameters in a file, but since this is for my personal use I don’t really care. For now.

What does this do?

  • I know that multiplexing can be done with tmux or screen, and that there are probably 100s of mobile SSH clients. You will also be able to collaborate with others that way. No one ever does that though. Why do you think that is?

  • I am also aware that web editors / web IDEs aren’t as versatile as Vim. So in fact this is a downgrade, but it’s webified?

So someone has put to gether 50k lines of code to downgrade the VT100 terminal experience?

Nope, it's not VT100. It's a workspace service application

For one reason or another it’s simply more comfortable.

Browsers are more than just website renderers. They are the access utilities to a modern service application. The way web apps are developed has pushed software development to service development. So your Cloud9 actually is your personal dev workspace / dev terminal service.

For most well versed developers a terminal is not a barrier, but using a mobile SSH client simply sucks. This way you don’t have to do that and you can simply keep the workspace persistent. With the terminal sessions, and the files you are editing. And with the inline completions you need, and the SSH keys you have put there.

The real question is: is the connection reliable enough for the websockets? Does this work through a CDN?
Resource wise Javascript / node.js is great. But depending on where you want to self-service your workspace experience from, there can be issues. The good thing is that you don’t lose data. The bad thing is, that it’s really bothersome if your text does not show up. Projects like mosh have solved this for SSH. Let’s see what the Web comes up with in regards to websocket reliability. :wink: