Skip to content
This repository

Create, scale and upgrade your company's own Cloud Foundry

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 docs
Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Guardfile
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 Rakefile
Octocat-spinner-32 bosh-cloudfoundry.gemspec


You want Cloud Foundry? You can now create, scale, upgrade and patch one or more Cloud Foundry deployments using very simple, easy to learn and remember CLI commands.

Currently supports AWS and OpenStack only. vSphere and vCloud support will require someone to tell me that they really want it.

Build Status Code Climate

Zero to Cloud Foundry in a few hours

If you have an AWS or OpenStack account then you can deploy a running Cloud Foundry VM by following this very simple tutorial. It first uses the very powerful bosh-bootstrap tool to deploy a BOSH, and then using this project (a plugin for the BOSH CLI) it will do everything necessary to deploy Cloud Foundry via your shiny new, empty BOSH.

You should not need to know anything before running this tutorial. If you do this tutorial and you feel it was too complex or you needed to know something additional, please create a ticket.

Run these steps on your local laptop/desktop

gem install bosh-bootstrap
bosh-bootstrap deploy
# prompts for AWS/OpenStack credentials
# and some other fields that you can
# just press Enter for.

SSH into inception VM and run these commands on that inception VM

(also see 'tmux' and 'mosh' commands)

bosh-bootstrap ssh

bosh cf prepare system production
# prompts for a DNS host for your CloudFoundry, such as
# will generate a new IP address
# now setup your DNS for * => new IP address
# the re-run:
bosh cf prepare system production

# use special "cf deploy" to install VMC & create initial VMC user
bosh cf deploy

# now we can grow our single VM deployment

bosh cf change deas 1
bosh cf add service postgresql
bosh deploy

Overtime, as you add more DEAs and other service nodes, your set of VMs might look like:

$ bosh vms
| Job/index                   | State   | Resource Pool             | IPs                         |
| core/0                      | running | core                      |, |
| dea/0                       | running | dea                       |                   |
| dea/1                       | running | dea                       |                |
| postgresql_m1_medium_free/0 | running | postgresql_m1_medium_free |                 |
| postgresql_m1_small_free/0  | running | postgresql_m1_small_free  |               |
| postgresql_m1_small_free/1  | running | postgresql_m1_small_free  |               |


  • Ruby 1.9
  • BOSH running on AWS (other CPIs coming)
  • Unix-based local system (Windows support for bosh-bootstrap is a priority)


The tool is very simple to use and to get CloudFoundry deployed on a small set of initial servers.

gem install bosh-cloudfoundry
bosh cf prepare system demo
bosh cf deploy

The above can be run the following from your local laptop or a server, such as an bosh-bootstrap inception server.

The latter is preferred. As the Cloud Foundry BOSH release (cf-release) is 1.5 Gb, it may be preferable to manage your Cloud Foundry deployments from your inception server, as created/prepared via bosh-bootstrap.

bosh-bootstrap deploy --latest-stemcell
bosh-bootstrap ssh

# now on the inception VM
gem install bosh-cloudfoundry
export TMPDIR=/var/vcap/store/tmp
bosh cf prepare system production
# prompts for a DNS host for your CloudFoundry, such as
bosh cf change deas 1
bosh cf add service postgresql 1
bosh cf deploy

During bosh cf prepare system production, it will automatically upload the latest release of CloudFoundry (the latest final BOSH release) and the latest stable stemcell (becomes the base AMI for AWS, for example).

NOTE: export TMPDIR=/var/vcap/store/tmp tells the upload process to use the larger mounted volume at /var/vcap/store.

You can upload a more recent stemcell or create a new one from source, respectively:

bosh cf upload stemcell --latest
bosh cf upload stemcell --custom

You can upload a more recent final BOSH release of CloudFoundry, or create a non-final version from the very latest commits to the CloudFoundry BOSH release, respectively:

bosh cf upload release
bosh cf upload release --dev

All available commands

Prefix each with bosh:

cf prepare system [<name>] [--core-ip ip] [--root-dns dns] 
                  [--core-server-flavor flavor] [--release-name name] [--release-version 
                  version] [--stemcell-name name] [--stemcell-version version] 
                  [--admin-emails email1,email2] [--skip-validations] 
    create CloudFoundry system 
    --core-ip ip                 Static IP for CloudController/router, e.g. 
    --root-dns dns               Base DNS for CloudFoundry applications, e.g. 
    --core-server-flavor flavor  Flavor of the CloudFoundry Core server. Default: 'm1.large' 
    --release-name name          Name of BOSH release within target BOSH. Default: 'appcloud' 
    --release-version version    Version of target BOSH release within target BOSH. Default: 'latest' 
    --stemcell-name name         Name of BOSH stemcell within target BOSH. Default: 'bosh-stemcell' 
    --stemcell-version version   Version of BOSH stemcell within target BOSH. Default: determines latest for stemcell 
    --admin-emails email1,email2 Admin email accounts in created CloudFoundry 
    --skip-validations           Skip all validations 

cf change deas [<server_count>] [--flavor flavor] 
    change the number/flavor of DEA servers (servers that run CF apps) 
    --flavor flavor Change flavor of all DEA servers 

cf add service <service_name> [<additional_count>] [--flavor flavor] 
    add additional CloudFoundry service node 
    --flavor flavor Server flavor for additional service nodes 

cf upload stemcell [--latest] [--custom] 
    download/create stemcell & upload to BOSH 
    --latest Use latest stemcell; possibly not tagged stable 
    --custom Create custom stemcell from BOSH git source 

cf upload release [--dev] 
    fetch & upload public cloudfoundry release to BOSH 
    --dev Create development release from very latest cf-release commits 

cf deploy 
    deploy CloudFoundry system or apply any changes 

cf watch nats 
    subscribe to all nats messages within CloudFoundry


By default your CloudFoundry deployment comes with no built-in services. Instead, you easily enable each one and allocate it resources using the bosh cf add service NAME command; then deploy again.

$ bosh cf add service postgresql
$ bosh cf add service redis
$ bosh deploy

Eventually the new service node servers will be up and running, and then the VMC client will be able to create/bind/delete these services with your CloudFoundry applications.

For example:

============== System Services ==============

| Service    | Version | Description                           |
| postgresql | 9.0     | PostgreSQL database service (vFabric) |
| redis      | 2.2     | Redis key-value store service         |


| Name             | Service    |
| postgresql-6d01e | postgresql |
| postgresql-ff0c1 | postgresql |
| redis-d0d3d      | redis      |

Orders of easiness vs powerfulness

|              |     |                 |       |                     |
|  CLI         |     |                 |       |                     |
|  commands    +---->|                 |       |                     |
|              |     |  system         |       |  deployment         |
|              |     |  config         |       |  manifest           |
+--------------+     |  (yaml)         |       |  (yaml)             |
                     |                 +------>|                     |
                     |                 |       |                     |
                     |                 |       |                     |
                     |                 |       |                     |
                     |                 |       |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |
                                               |                     |


bundle exec rake spec
bundle exec rake install


  1. Fork it
  5. Create new Pull Request

Bitdeli Badge

Something went wrong with that request. Please try again.