Remote Editing Using Atom

Atom has quickly become my favorite code editor. Since I've successfully deployed the MEAN stack to my Digital Ocean droplet, I now want to be able to edit files on the server from the comfort of my own Windows box. This one got a little dicey, but I was able to figure it out. Here goes:

A few prerequisites that are not included in this guide:

  1. You'll need a remote server with SSH working
  2. You'll need to install Atom on your Windows box
  3. You'll need to install PuTTY on your Windows box

Now to the good stuff:

Open up Atom and install the 'remote-adam' package

On your remote server, install 'rmate'

curl -o /usr/local/bin/rmate
sudo chmod +x /usr/local/bin/rmate

I renamed 'rmate' to 'ratom'.

sudo mv /usr/local/bin/rmate /usr/local/bin/ratom

Set up PuTTY

  1. Set up your SSH session the way you normally would
  2. Navigate to Connection -> SSH -> Tunnels
  3. Under 'Add new forwarded port', enter 52698 for the source port, localhost:52698 for the destination, and choose the 'Remote' radio button
  4. Go back to the main screen and save what you've done so you don't have to do it again

Connect to your remote server using PuTTY and the settings you just created.

In Atom, click 'Packages' and then 'Remote Atom' -> 'Start Server'.

Finally, on your remote server, type

ratom path_to_file/filename

and you will magically be editing that file on your local machine!

Every time  you save, remote-atom will upload the document back to the remote server.

To finish, close the last file in Atom, then click 'Packages' and 'Remote Atom' -> 'Stop Server'. You can then close your SSH connection.