Working with Pivotal Cloud Foundry Web Services with a free Account

To Start working on Pivotal Cloud Foundry PAAS Platform first create a free account on and get a trial account.

After registration login with the following URL to the public PAAS environment and create an ORG for your account.

Pivotal WS account

Next download the cf command line tool from the following URL

Unzip the installer and double click on the installer named cf_installer.exe

After installing the cf CLI execute the command cf -v to see if the cf command works fine or not.

CF instalation

D:\CloudFoundryDev\cf-sample-app-spring>cf -v
cf version 6.38.0+7ddf0aadd.2018-08-07

To test an application you need to either programm your own application or you can download or clone an application from github

To clone an application from github you ll need git tool ,so install git on your desktop or laptop

Clone the code repository to your local folder

D:\CloudFoundryDev>git clone

D:\CloudFoundryDev>cd cf-sample-app-spring

D:\CloudFoundryDev\cf-sample-app-spring>cf login -a

Provide the username and password for your pivotal trial account.

cf-login-public paas

After login execute the command

D:\CloudFoundryDev\cf-sample-app-spring>cf push

This will push the application to the cloud foundry PASS platform

I ll give a small explanation of what happens when you execute the command cf push

push sequence

1.User execute cf push on CLI

2.Cf CLI tells the cloud controller to create a record for the application.

3.Cloud controller stores application metadata

4.Before uploading all the application source files, the cf CLI issues a resource match request to the cloud controller to determine if any of the application files already exist in the resource cache.

5.The cloud controller stores the application package in the blobstore.

6.The cf cli issues an app start command.

7.The cloud controller issues a staging request to diego, which then schedules a diego cell(“cell”) to run the staging task (“task”)

8.The cell streams the output of the staging process so the developer can troubleshoot application staging problems.

9.The task packages the resulting compiled and staged application into a tarball called a “droplet” and the cell stores the droplet in the blobstore.

10.The diego bulletin board system reports to the cloud controller that staging is complete.

11.Diego schedules the application as a long running process on one or more diego cells.

12.The diego cells report the status of the application to the cloud controller.

running app


To View the sample app Logs run the following command

D:\CloudFoundryDev\cf logs cf-spring –recent

Or, stream live logs: D:\CloudFoundryDev\cf logs cf-spring

Now let’s connect a Database

PCF enables administrators to provide a variety of services on the platform that can easily be consumed by applications.

List the available ElephantSQL plans:

D:\CloudFoundryDev\cf marketplace -s elephantsql

Create a service instance with the free plan:

You can create a service instance from CF CLI or from the Web Services Console too.



D:\CloudFoundryDev\cf create-service elephantsql turtle cf-spring-db


Bind the newly created service to the app:

cf bind-service cf-spring cf-spring-db


Once a service is bound to an app, environment variables are stored that allow the app to connect to the service after a push, restage, or restart command.

Restart the app:

cf restart cf-spring

cf services


Scale the Application on Pivotal PAAS.

Increasing the available disk space or memory can improve overall app performance. Similarly, running additional instances of an app can allow an app to handle increases in user load and concurrent requests.

These adjustments are called scaling.

You can do scaling either from  the Web Application Manager or using the CF CLI.


Scaling your app horizontally adds or removes app instances. Adding more instances allows your application to handle increased traffic and demand.


Scaling your app horizontally adds or removes app instances. Adding more instances allows your application to handle increased traffic and demand.

Increase the number of app instances from one to two:

cf scale cf-spring -i 2


Increase the memory limit for each app instance:

cf scale cf-spring -m 1G


Increase the disk limit for each app instance:

cf scale cf-spring -k 512M



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s