Coding in the cloud without the need of local environment

At our company, we have been getting a few WordPress-based website jobs lately. Usually, three of us work simultaneously on such a project and need to edit the same codebase with the same database (so the theme settings and content stays the same). We can share the changed files through git and database through exports and imports. However, this process is tedious and it slows down the development speed.

The Solution.

So, how to solve this problem?

Koding.com (referral link)

Enter Koding.com.

Koding.com is an online development environment with access to a real console (with Vim and everything!) and file editor with syntax highlighting. Simply put, it is like a VPS hosting (with Ubuntu as of writing) with file editing capabilities in your browser.

It means that you can install, configure and deploy apps such as apache, mysql, php, ruby, rails, you name it. It comes with some of them preinstalled (e.g. LAMP) so you can jump in, clone your git repo and start developing right away without the need of installing everything locally and then configuring it.

After signing up, you get 1 CPU, 1 GB of RAM and 3GB of space for free and also .kd.io domain so you can see the fruits of your hard work. Of course, you can setup apache for your own domain name and have that connected to your Koding.com virtual machine.

I think the best way to understand and see what it can do is to register and try it for free at your own.

Configuring sshfs, alias how to easily manage the files on your Koding.com VM.

While it is true that Koding.com gives us an option to upload, move and delete files right in the browser, uploading files is not working for me at the moment (I’m using Safari) and I like to have a better control over the process of managing files. How to solve this issue?

A while ago I told you that you have access to real console in real Ubuntu. We can use this fact and setup sshfs so Koding’s filesystem will mount locally in our OS. You need to have sshfs installed and working on your local system, though.

Keys and SSH

  1. Generate an RSA ssh key on your local machine (guide)
  2. Copy your id_rsa.pub (public part of your generated key) into Koding’s .ssh/authorized_keys file.
  3. Add this id_rsa.pub also in your Koding’s Account Management under the SSH Keys settings.
  4. Create a config for connecting into Koding’s ssh server in your local machine’s .ssh/config file.
    Host *.kd.io
     User <your user name>
     ProxyCommand ssh %r@ssh.koding.com nc %h %p

    We need this config because Koding uses multiple servers (proxy) to access your VM.

  5. You can then connect to the Koding’s console with the command
    ssh <vm-number>.<your user name>.koding.kd.io

    For example, connecting to one of my VM looks like this

    ssh vm-0.lamosty.koding.kd.io
  6. Create some temporary folder for mounting your coding file system. I have created a folder called tempMount.
  7. Finally, you can mount the remote filesystem with the help of sshfs command by typing this command
    sshfs <vm-number>.<username>.koding.kd.io:/home/<username>/ tempMount

And that’s it! Have fun with your Koding.com VM and try new things there.

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: