How to deploy Cloud Foundry on your local machine.

In this article, we’ll look at bosh-lite open source project to deploy CF in a single Virtual Machine (VM) using Vagrant and VirtualBox.


You must have a mac with 16GB ram.  If you have a proxy please check that you set your proxy settings:

export http_proxy=
export https_proxy=


Detail instruction how to install CF –

I just put commands and detail explanations of common error or warning that I encountered during installation.

  1. Install bosh_cli aka bosh command
    $ gem install bosh_cli
    check version of bosh
    $ bosh -v
    BOSH 1.2827.0
  2. Install Vagrant –
    check version of Vagrant
    $ vagrant -v
    Vagrant 1.7.2
  3. Clone bosh-lite repository under ~/workspace/
    $ git clone
    $ ls ~/workspace/
  4. Install VirtualBox –
    check version of virtual box
    $ vboxManage -v
  5. Create new VM
    $ cd ~/workspace/bosh-lite
    $ vagrant up –provider=virtualboxIf have an error:
The box 'cloudfoundry/bosh-lite' could not be found or

could not be accessed in the remote catalog. If this is a private

box on HashiCorp's Atlas, please verify you're logged in via

`vagrant login`. Also, please double-check the name. The expanded

URL and error message are shown below:

URL: [""]


You need to comment or remove code in


if @command[0].downcase.include?(installer_dir)"Command in the installer. Specifying DYLD_LIBRARY_PATH...")
 process.environment["DYLD_LIBRARY_PATH"] =
 "#{installer_dir}/lib:#{ENV["DYLD_LIBRARY_PATH"]}""process.environment")["DYLD_LIBRARY_PATH"])"end process.environment")
 @logger.debug("Command not in installer, not touching env vars.")
  1. Run bosh Director
    # if behind a proxy, exclude this IP by setting no_proxy
    $ export no_proxy=,
    $ bosh target lite
    Target set to `Bosh Lite Director’
    $ bosh login
    Your username: admin
    Enter password: admin
  2. Add a set of route$ bin/add-route
  3. Install Spiff
    $ brew tap xoebus/homebrew-cloudfoundry
    $ brew install spiff
    $ spiff -v
    spiff version 1.0.3
  4. $ cd ~/workspace
    $ git clone
  5. $ cd ~/workspace/cf-release
  6. Upload release
    $ ls releases/
    cf cf-142.yml cf-149.yml cf-156.yml cf-164.yml cf-172.yml cf-180.yml cf-190.yml cf-197.yml
    cf-136.yml cf-143.yml cf-150.yml cf-157.yml cf-165.yml cf-173.yml cf-182.yml cf-191.yml index.yml
    cf-137.yml cf-144.yml cf-151.yml cf-158.yml cf-166.yml cf-175.yml cf-183.yml cf-192.yml
    cf-138.yml cf-145.yml cf-152.yml cf-159.yml cf-168.yml cf-176.yml cf-186.yml cf-193.yml
    cf-139.yml cf-146.yml cf-153.yml cf-160.yml cf-169.yml cf-177.yml cf-187.yml cf-194.yml
    cf-140.yml cf-147.yml cf-154.yml cf-161.yml cf-170.yml cf-178.yml cf-188.yml cf-195.yml
    cf-141.yml cf-148.yml cf-155.yml cf-163.yml cf-171.yml cf-179.yml cf-189.yml cf-196.yml
  7. $ bosh upload release releases/cf-196.yml # according google group 196 last stable release at this moment
    It takes about 30 minutes.
  8. $ wget
  9. $ bosh upload stemcell latest-bosh-stemcell-warden.tgz
  10. $ cd ~/workspace/bosh-lite
  11. $ bosh deployment manifests/cf-manifest.yml
  12. $ bosh deploy
    # enter yes to confirm
    It takes another 30 minutes or more.

Run test 

You need to run test using the following recommendations  cf-acceptance-tests.
Create integration_config.json that seems like below

 "api": "",
 "admin_user": "admin",
 "admin_password": "admin",
 "apps_domain": "",
 "skip_ssl_validation": true,
 "persistent_app_host": "myapp",
 "persistent_app_space": "myspace",
 "persistent_app_org": "myorg",
 "persistent_app_quota_name": "myquota",
 "default_timeout": 45,
 "cf_push_timeout": 180,
 "long_curl_timeout": 180,
 "broker_start_timeout": 300
  1. $ export CONFIG=~/workspace/integration_config.json
  2. $ mkdir -p ~/go
  3. $ export GOPATH=~/go
  4. $ go get
  5. $ cd $GOPATH/src/
  6. $ ./bin/test

After test run you may check CF

$ cf l
API endpoint:
Email> admin
Password> admin

Targeted org myorg
Targeted space myspace

API endpoint: (API version: 2.21.0)
User: admin
Org: myorg
Space: myspace
$ cf domains
Getting domains in org myorg as admin...
name status shared
$ cf apps
Getting apps in org myorg / space myspace as admin...
name requested state instances memory disk urls
myapp started 1/1 256M 1G
$ curl
Hi, I'm Dora!

Create a directory 
$ mkdir test-hi
$ cd test-hi
$ vim test-hi.php
<?php print("Hi, Sergey!"); ?>
$ cf push test-hi
Creating app test-hi in org myorg / space myspace as admin...
Creating route
Binding to test-hi...
Uploading test-hi...
Uploading app files from: /Users/212396313/workspace/test-hi
Uploading 164, 1 files
Done uploading
Starting app test-hi in org myorg / space myspace as admin...
-----> Downloaded app package (4.0K)
-------> Buildpack version 1.0.2
Use locally cached dependencies where possible
! WARNING: No composer.json found.
Using index.php to declare PHP applications is considered legacy
functionality and may lead to unexpected behavior.
-----> Setting up runtime environment...
- PHP 5.5.12
- Apache 2.4.9
- Nginx 1.4.6
-----> Installing PHP extensions:
- opcache (automatic; bundled, using 'ext-opcache.ini')
-----> Installing dependencies...
Composer version ac497feabaa0d247c441178b7b4aaa4c61b07399 2014-06-10 14:13:12
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/app/.heroku/php/bin/composer self-update" to get the latest version.
Loading composer repositories with package information
Installing dependencies
Nothing to install or update
Generating optimized autoload files
-----> Building runtime environment...
NOTICE: No Procfile, defaulting to 'web: vendor/bin/heroku-php-apache2'
-----> Uploading droplet (64M)
1 of 1 instances running
App started
App test-hi was started using this command `vendor/bin/heroku-php-apache2`
Showing health and status for app test-hi in org myorg / space myspace as admin...
requested state: started
instances: 1/1
usage: 256M x 1 instances
last uploaded: Wed Feb 11 00:07:11 +0000 2015
state since cpu memory disk
#0 running 2015-02-10 04:07:55 PM 0.7% 92.4M of 256M 0 of 1G
$ cf apps
Getting apps in org myorg / space myspace as admin...
name requested state instances memory disk urls
myapp started 1/1 256M 1G
test-hi started 1/1 256M 1G
$ curl
Hi, Sergey!

How to handle your Virtual Machine (VM) 

The best practice  to handle VM is to use vagrant commands for Virtual Box.  To suspend your VM when you do not need it for awhile you may use $ vagrant suspend command that saves your VM state at the point of time and VM will stop running.  When you need your VM running again you have to use $ vagrant resume command and then use $ bosh cck command to be sure that CF is working fine.

$ vagrant suspend
==> default: Saving VM state and suspending execution...
$ vagrant resume
==> default: Resuming suspended VM...
==> default: Booting VM...
==>; default: Waiting for machine to boot. This may take a few minutes...
 default: SSH address:
 default: SSH username: vagrant
 default: SSH auth method: private key
 default: Warning: Connection refused. Retrying...
==> default: Machine booted and ready!
$ bosh cck
Performing cloud check...
Processing deployment manifest
Director task 8
Started scanning 14 vms
Started scanning 14 vms > Checking VM states. Done (00:00:00)
Started scanning 14 vms > 14 OK, 0 unresponsive, 0 missing, 0 unbound, 0 out of sync. Done (00:00:00)
Done scanning 14 vms (00:00:00)
Started scanning 3 persistent disks
Started scanning 3 persistent disks > Looking for inactive disks. Done (00:00:00)
Started scanning 3 persistent disks > 3 OK, 0 missing, 0 inactive, 0 mount-info mismatch. Done (00:00:00)
Done scanning 3 persistent disks (00:00:00)
Task 8 done
Started 2015-02-12 19:04:42 UTC
Finished 2015-02-12 19:04:42 UTC
Duration 00:00:00
Scan is complete, checking if any problems found...
No problems found

How to integrate local CF into Eclipse

Go to Server view> New > Server take Pivotal\Cloud Foundry

Screen Shot 2015-02-13 at 2.38.59 PM
Enter account information
email: admin
Password: admin

Screen Shot 2015-02-13 at 2.39.38 PM

After that you may handle your local CF from Eclipse view.

Screen Shot 2015-02-12 at 12.11.11 PM

Useful Links 

Detail instruction how to install CF (Bosh Lite) –

Current status Cloud Foundry project –!topic/vcap-dev/JjcdDRGBcnk

Getting Started with the CF

Troubleshooting CF

6 thoughts on “How to deploy Cloud Foundry on your local machine.

  1. Hey, Thank you for this nice step by step guide. I just finished installing local cloud foundry.
    Now I am trying to deploy the hello-spring-cloud from in my local vm. But this sample application needs 4 services.
    Do I need to create those services in my local vm. I could not find a guide on how to do that.

    I see that you have a guide to install mysql in local vm. I need to figure out the postgres services first. When I type bosh vms, I see that there is already a postgres_z1/0 job running.

    Can you please provide some guidance here? How to deploy apps which have dependency on relational db and queues for example in my local cloud foundry vm.

  2. Pingback: Cómo instalar Cloud Foundry en local (Ubuntu) | David Muñoz Fernández

  3. Pingback: Deploying Cloud Foundry – On Vagrant, On VirtualBox, On Windows 10 | Cloud Transformations

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