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:
- You'll need a remote server with SSH working
- You'll need to install Atom on your Windows box
- 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 https://raw.githubusercontent.com/aurora/rmate/master/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
- Set up your SSH session the way you normally would
- Navigate to Connection -> SSH -> Tunnels
- Under 'Add new forwarded port', enter 52698 for the source port, localhost:52698 for the destination, and choose the 'Remote' radio button
- 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
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.