AppFog Cloud Platform is built by using the Cloud Foundry OSS bits alongside its own set of custom extensions and enhancements. AppFog provides good command line tool to deploy application but we can configure Cloud Foundry Integration plugin of Eclipse / Spring Tool Suite (STS) to deploy web application directly from IDE to the AppFog.

Technologies used in this article

  1. Spring Tool Suite
  2. Cloud Foundry Integration Extension for STS
  3. AppFog PaaS

1. Create a Dynamic Web Project

Create a dynamic web project (say 'AFHello') with a jsp page (say 'afHello.jsp'). We'll deploy this web application to AppFog Cloud Platform.
File : afHello.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>App Fog Hello</title>
Successfully deployed in App Fog cloud using Cloud Foundry Integration plugin of Eclipse / STS

2. Install Cloud Foundry Integration Extension

Install Cloud Foundry Integration Extension in Eclipse or Spring Tool Suite (STS) IDE

3. Define a new server

Click File --> New --> Other --> Server --> VMware --> Cloud Foundry
Define a new server

Cloud Foundry Account

4. Add AppFog cloud url

Click 'Manage Cloud' --> 'Add'. Enter the AppFog cloud url '' and click the 'Finish' button.
Manage Cloud Url

Add Cloud url

5. Configure AppFog Account

Enter AppFog account's email, password and select App Fog Cloud as url. Click the 'Validate Account' button to check whether all the configurations are correct ot not. Click 'Finish' button.
Configure AppFog Account

6. Deploy Application

Drag your application and drop it to the 'App Fog Cloud' server. Provide 'Application Details' and click 'Next' button.
Application Details

In 'Launch Deployment' window provide deployed url (for example '').
Launch Deployment

Deployed url needs to be unique and it is comprised of two parts - subdomain (eg. afhello) and infrastructure (Amazon Web services - where we want to deploy our application. AppFog provides different OpenStack-based IaaS like Rackspace or HP to AWS. As of now, following infrastructures are provided by AppFog PaaS

  1. AWS Asia Southeast (
  2. AWS Europe West (
  3. AWS US East (
  4. HP Openstack AZ 2 (
  5. Rackspace DFW (

Deployed Application

If the url is already used by any other AppFog user then you can change the same using the 'Edit' button of 'Mapped Url'

7. Browser output

Open the mapped url ('') in the browser.
Browser output

Download SrcCodes

All code samples shown in this post are available in the following link