Note: Please go to to access the current RightScale documentation set.
Home > FAQs > How do I create a tarball (.tgz or .tar.gz) of my application code in Linux?

How do I create a tarball (.tgz or .tar.gz) of my application code in Linux?

Table of Contents


You have all of your application code on a running Linux server and you want to create a tarball (.tgz or .tar.gz) of the codebase so that you can upload it to a remote object storage (ROS) container so that it can be retrieved at boot time by an application server. 

ServerTemplates published by RightScale contain scripts that retrieve application code by checking it out from a software code repository (Git or SVN) or downloading a tarball from an ROS container.


  1. SSH into the running Linux server that contains your application code.
  2. Locate the root directory of your application. If you used an application ServerTemplate published by RightScale, the default directory is /home/webapps/<APPLICATION_NAME>

    For example:
# sudo -i
# cd /home/webapps
# ls
myapp   myapptimestamp
# cd myapp
  1. Once you are in the root directory, run the following UNIX command to create a tarball and save it in the directory above. You can create either a .tgz or a tar.gz file type. In the example below, we're creating a file called 'phpapp.tgz'.
# tar -cvzf ../phpapp.tgz *

# ls ../
myapp   myapptimestamp   phpapp.tgz
  1. (Optional) Use the sample code below to send an email to yourself with the tarball as an attachment so that you can upload it to an ROS container. Follow the subsequent instructions to configure the contents of the email message.

    For example:
# mutt -s "MessageTitle" -a /home/webapps/phpapp.tgz
You must to post a comment.
Last modified
21:29, 16 May 2013



This page has no classifications.



Glossary | 用語용어 Site Map | Site Help Community Corporate Site Get Support Dashboard Login
Doc Feedback Product Feedback Resources MultiCloud Marketplace Forums

Dashboard Status

© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.