with AWS Elastic Beanstalk

This tutorial will cover how to update your existing application and then how to delete your Elastic Beanstalk environment, which includes your application. This tutorial is a continuation from the Launch an Application with AWS Elastic Beanstalk tutorial, so please go through that tutorial first if you haven’t already. This tutorial will cover how to update your existing application and then how to get rid of your Elastic Beanstalk environment, which includes your application.

Updating an Application with AWS Requires an Account

Create a Free Account in Minutes

Receive twelve months of access to the AWS Free Usage Tier and enjoy AWS Basic Support features including, 24x7x365 customer service, support forums, and more.


a. Navigate to the directory where you downloaded the php-v1.zip file in the previous tutorial.

Windows Users: To unzip the php-v1.zip file, right click on the php-v1.zip file, click Extract All..., then click Extract.

Mac Users: Double click on the php-v1.zip file, and this will automatically unzip the file into a php-v1 folder in the same directory.

b. Navigate into the newly unzipped php-v1 directory. Open index.php using your favorite text editor. You will make a small edit here that is an example of an application change. Look on line 26 for <h1>Congratulations!</h1>. Replace Congratulations!, with Application Updated! in between the <h1> and </h1> tags. Then save the index.php file (overwriting the original).

(click to zoom)

Next you will need to zip your application so it can be uploaded to AWS as an update package.

Windows users: Please select Windows below to see how to create the zipped application file.

Mac & Linux users: Please select Mac/Linux below to see how to create the zipped application file.

  • Windows

    c. Select all 6 items (including the .ebextensions directory), right-click on .ebextensions, select Send to, and then click on Compressed (zipped) folder.

    (click to zoom)

    d. Rename the newly created zip file to php-v2.zip.

    Note: On some Windows systems the .zip part of the file name may be hidden (see the example image).

    (click to zoom)

  • Mac/Linux

    c. OSX users: Open a terminal window by pressing command + space and typing terminal in the search window. Then press enter to open the terminal window.

    Linux users: Open a terminal window.

    (click to zoom)

    d. Next, you need to navigate to the directory where you downloaded the php-v1.zip file (the default location for file downloads is the Downloads directory so the example here uses that directory; if you downloaded to a different directory, change to that directory instead). (ex. cd ~/Downloads/php-v2)

    When you are in the directory with the index.php file you modified in step 1 part b, zip the files (and a hidden directory called .ebextensions) by typing zip –r php-v2.zip .e* * to create php-v2.zip with the updated PHP project in it.

    (click to zoom)

a. Click here to open the Elastic Beanstalk console. Within the Elastic Beanstalk dashboard, click on php-sample-app at the top of your screen, and this should show a drop-down menu where you should select Application Versions.

(click to zoom)

b. Here you should see one entry in the Version Label column titled First Release. The Source column for this entry should show the php-v1.zip file we uploaded in the previous tutorial. Click on Upload, enter Second Release for Version label, then Sample PHP App Update for Description. Click Browse, then navigate to the location where your php-v2.zip file is located, Select the php-v2.zip file and click Upload.

(click to zoom)

c. You should now see Second Release within the application versions table. Check the box for Second Release, then click Deploy. You should see your Environment defaulted to phpSampleApp-env. Leave the default settings here and click Deploy. Lastly, click Elastic Beanstalk in the top left hand corner of the web page.

(click to zoom)

d. Click on the green box titled phpSampleApp-env to see the view of your application's environment.

(click to zoom)

e. Here, you can see a Recent Events section that displays your application being updated.

(click to zoom)

a. Once you see Environment update completed successfully within Recent Events, click on your application URL toward the center top of the screen to view your updated application.

(click to zoom)

b. You will see that instead of the Congratulations! text that existed in version 1 of your application the text has been updated to version 2 with the heading Application Updated!

Congratulations! You have successfully updated your AWS Elastic Beanstalk application.

(click to zoom)

a. To delete your application (and stop using the AWS resources associated with your application), access your Elastic Beanstalk application dashboard, click on Actions in the top right-hand corner, then select Terminate Environment.

(click to zoom)

b. You will be presented with a warning/confirmation screen. Click Terminate to continue.

Note: It may take a couple of minutes for the environment to completely shut down.

(click to zoom)

Now that you have an Elastic Beanstalk application up and running, the next tutorial will walk you through registering a domain name so your website/application can be easy to access.

Getting a Domain for Your Application »