Remotely Connect to Your EC2 Server Using Coda FTP

Getting Coda to Remotely Connect to Your EC2 Server

Okay, so let’s jump to it. How do you get Coda to connect to your EC2 server?

First thing you will need is your private key (the file that you should have received from Amazon that ends in PEM). If you don’t have one of these babies then you’re going to need to go through Amazon’s getting started guide paying specific attention to section 3 & 4 on the “Launch Instance” section and the “Connect to Linux/Unix/Windows Instance”.

For the purposes of this walk through we’ll assume that the name of your private key is: my_key.pem

Now that you have your key you will need to move it to your ssh directory. Opening up Terminal, go to your ssh directory by typing:

You may either choose to copy your key into this folder, or, you can leave your private key wherever it so provided you know the path to it. Copying the file to the ssh directory would require you to do this:

Once you have either copied your key or noted its exact location in the ssh directory that you are actively in edit the config

Even if you don’t have that file, by doing the above you will be creating it. You may also need to be super-user if no permission is given:

In this file add the following lines (instructions of each line are after the # mark so you may remove information after these):

To save this document in vim you will need to exit by hitting :wq and then hitenter to save the document.

When this done, if you private key hasn’t been added you should do that now by entering:


To test that there are no problems with connecting to your server, enter in terminal the next command:

(instead of root you may be asked to use ubuntu instead, i.e.

If you receive any

errors at the bottom of the text you will have to change the permission of your key file, to do this enter:


Then try running the previous command again.

If you find upon running the

that you are faced with a prompt that asks you a yes/no question, enter “yes”.

Once you have successfully gained access to your EC2 server from the terminal window you are now almost ready to interface your server with Coda!

Open up Coda, click on the Sites tab button, click Add Site…and in all the text-boxes add the appropriate information according to your settings from the image above. A little more detail is provided here:

  • Nickname: can be anything you want to help you identify the site in Coda.
  • Root URL: URL to access the site.
  • Local URL: local location of the site (I use MAMP to test my sites)
  • Remote Root: where the server files are located that are directly correlated to the local structure
  • Local Root: where the local file/folder structure can be found
  • Server: the “Host” name you inserted in the config file above, i.e. (or the public DNS address)
  • User Name: either “root” or “ubuntu” or whatever the server requests as a user to log in to the server
  • Password: LEAVE BLANK!
  • Port: leave on the default 22
  • Protocal: SFTP

When all this has been done you can click on “Save”. When you’re sure that all the details match up correctly, click connect in the “Remote” tab area and hopefully everything should work as it should! If you do get password prompts check that your key file has been chmod to 600 (see above) and that your ~/.ssh directory has been chmod to 700.

If you still run into problems PLEASE check that all the server details and username details are correct. I had my server IP address round the wrong way and that threw out a few attempts.

Anyway, hopefully this helps you integrate Coda and your EC2 server together quicker.

PS: make sure your folder has permissions for the user you are uploading the data to, I had to run this command in terminal before it allowed me to upload files from within Coda:

Share on FacebookShare on Google+Email this to someoneShare on RedditShare on LinkedInShare on TumblrTweet about this on TwitterShare on StumbleUpon

One response to “Remotely Connect to Your EC2 Server Using Coda FTP”

  1. Excellent! Thank you. I didn’t think about setting up the key like this and leaving the password blank. Especially because Filezilla allows direct interaction with key files.

Leave a Reply

Your email address will not be published.