FileZilla/SFTP to update applications on OpenShift- for Ubuntu users

You can update your application using GIT. OpenShift also provides SSHing into your application. You may have heard of FTP protocol which allows you to transfer files through web. Most hosting companies use FTP protocol to update client apps.

OpenShift unlike AppFog have FTP support, but in a different manner. It has SFTP support ie SSH File Transfer Protocol. SFTP is a FTP like protocol that allows transferring files via SSH sessions. Most FTP clients support SFTP. FTP client FileZilla supports SFTP which means that you can use FileZilla for updating site hosted on OpenShift. You can download FileZilla from here available for Linux, Mac & Windows.

You should mention the ssh-key you gave to OpenShift in FileZilla too.
For that Got to Edit Menu -> Settings and choose the tab SFTP:

 

Click on Add keyfile and choose the file containing the ssh-key. Normally on a Linux system it will be /home/user/.ssh/id_rsa. When you select the SSH key file, FileZilla will ask for to save the key file in a format FileZilla understands. Choose Yes and save it in /home/user/.ssh with the name filezilla.

 

Now, go to your OpenShift account and get the username of the SSH account.

Here’s how to get the username:

ssh://[email protected]/~/git/drupal.git/

 

The username of the above SSH command is 53817q965973ba4723444390 and the host is appname-domainame.rhcloud.com
Now, type in the credentials you got from the SSH command into FileZilla.
Example:

Host     : sftp:// appname-domainame.rhcloud.com

Username: 53817q965973ba4723444390

 

Leave the Password field blank, because we already have an ssh-key that will authorize us.

You will now have complete access to your app’s hosted directory.
If you want to update the source code paste/add/remove you’re source code in the app-root/repo/phpor whatever the language is.
Screenshot :

Note that if you do a git push to the application, the changes made by SFTP will be replaced. So, be careful while doing a git commit to application if you have made changes to code by SFTP.

6
1 Comment
  • business credit cards
    July 16, 2015

    Many thanks for sharing your experiences with others. You’re really creating a difference.

Leave a Reply

Your email address will not be published. Required fields are marked *