Cloud Foundry – Hosting a Static Web App

Step-by-Step Guide to publish your Static Web App


1. Create a sample Web/HTML page. Start by creating the application root directory.


$ mkdir /home/engineer/hello-pws

2. Enter the application root directory and create a sample HTML file for publishing. Use the following content of the HTML. Use your preferred text editor. Save the file as index.html

$ nano /home/engineer/hello-pws/index.html

Add the following content:

3. You should have the following similar structure.

4. Signup at for Pivotal Web Services

5. Install the command line tools, for the specific version for your OS, visit

Ubuntu 64-bit :

$ wget
$ sudo dpkg -i cf-cli-installer_6.34.1_x86-64.deb

6. Once installed, run the following on your command line, to login.

$ cf login -a

Enter your email and password that you registered at

7. Change to the application root directory

$ cd /home/engineer/hello-pws

8. Push your application to the PWS

$ cf push hello-pws-2 -b staticfile_buildpack

9. Wait until the deployment is finished. It will show something like:

10. Visit the following URL to open the application


11. You can check the applications and routes you have deployed by visting 


You have now successfully deployed a static web app. Congratulations!

Previous Setting up Let's Encrypt - SSL for Domains
Next Configure SSL in Nginx