Install Cloud Foundry on macOS with Virtualbox

We’re investigating Cloud Foundry for our PAAS solution. At home I’ve installed it on my mac with virtualbox. This post is a combination of information available elsewhere (links are included) and can be used to get you’re own local Cloud Foundry up and running.


Install VirtualBox (
Install VirtualBox extension pack
Install xcode

xcode-select --install

Install Homebrew ( and use it to install bosh-cli, openssl and node.js

brew install cloudfoundry/tap/bosh-cli
brew install openssl
brew install node

Now start installation …


Follow and you’ll have bosh-lite running. JUST DON’T INSTALL ZOOKEEPER! The script I’ve used is below. The last line adds a route to the system that is crucial for the cloud foundry cli to work.

git clone ~/workspace/bosh-deployment
mkdir -p ~/deployments/vbox
cd ~/deployments/vbox
bosh create-env ~/workspace/bosh-deployment/bosh.yml \
  --state ./state.json \
  -o ~/workspace/bosh-deployment/virtualbox/cpi.yml \
  -o ~/workspace/bosh-deployment/virtualbox/outbound-network.yml \
  -o ~/workspace/bosh-deployment/bosh-lite.yml \
  -o ~/workspace/bosh-deployment/bosh-lite-runc.yml \
  -o ~/workspace/bosh-deployment/uaa.yml \
  -o ~/workspace/bosh-deployment/credhub.yml \
  -o ~/workspace/bosh-deployment/jumpbox-user.yml \
  --vars-store ./creds.yml \
  -v director_name=bosh-lite \
  -v internal_ip= \
  -v internal_gw= \
  -v internal_cidr= \
  -v outbound_network_name=NatNetwork
bosh alias-env vbox -e --ca-cert <(bosh int ./creds.yml --path /director_ssl/ca)
export BOSH_CLIENT=admin
export BOSH_CLIENT_SECRET=`bosh int ./creds.yml --path /admin_password`
sudo route add -net # Mac OS X

Congratulations you’ve now got a working bosh-lite installation. You can use the bosh-cli to interact with it. Now install/deploy Cloud Foundry.

Cloud Foundry

Read up on but use the script below as it fills some holes.

git clone ~/workspace/cf-deployment
cd ~/workspace/cf-deployment
git checkout tags/v1.15.0
bosh update-cloud-config ~/workspace/cf-deployment/iaas-support/bosh-lite/cloud-config.yml
export STEMCELL_VERSION=$(bosh int cf-deployment.yml --path '/stemcells/alias=default/version')
bosh upload-stemcell "$STEMCELL_VERSION"
bosh -d cf deploy ~/workspace/cf-deployment/cf-deployment.yml \
-o ~/workspace/cf-deployment/operations/bosh-lite.yml \
-o ~/workspace/cf-deployment/operations/use-compiled-releases.yml \
--vars-store deployment-vars.yml \
-v system_domain=$SYSTEM_DOMAIN

Now login to you’re Cloud Foundry environment. The password for the admin user is revealed with the first statement of the script below.
More info on (

bosh interpolate --path /cf_admin_password ~/workspace/cf-deployment/deployment-vars.yml
cf login -a https://api.$SYSTEM_DOMAIN --skip-ssl-validation
cf create-org demo
cf target -o demo
cf create-space dev
cf target -o demo -s dev


A nice GUI for your Cloud Foundry is Stratos. You deploy Stratos to CF with details from This is where node.js is needed.

cd ~/workspace
git clone
cd stratos
git checkout tags/stable -b stable
npm install
npm run prebuild-ui
cf push

Now logon to Stratos on with Admin and the password from the first line in the previous script.

Save state the VirtualBox machine before shutdown to preserve your environment. After a restart create the route again.


If you’ve already installed node, make sure to update it to the latest version:

brew update
brew upgrade node
npm update -g npm

About erictummers

Working in a DevOps team is the best thing that happened to me. I like challenges and sharing the solutions with others. On my blog I’ll mostly post about my work, but expect an occasional home project, productivity tip and tooling review.
This entry was posted in Development and tagged , , , , . Bookmark the permalink.

7 Responses to Install Cloud Foundry on macOS with Virtualbox

  1. Pingback: Deploy your first dotnet core app to Cloud Foundry | .NET Development by Eric

  2. Immo Huneke says:

    This is a really nice and detailed recipe. Unfortunately I hit a snag during the cloud-foundry deployment:

    Creating disk… Finished (00:00:00)
    Attaching disk ‘disk-e1e46319-da4c-4d3c-6788-3f2bc3844b7e’ to VM ‘vm-c27e40b8-464c-4922-7078-03a2900425eb’… Failed (00:01:12)
    Failed deploying (00:01:48)

    Cleaning up rendered CPI jobs… Finished (00:00:00)

    Creating instance ‘bosh/0’:
    Updating instance disks:
    Updating disks:
    Deploying disk:
    Mounting disk:
    Sending ‘get_task’ to the agent:
    Agent responded with error: Action Failed get_task: Task c0345d0d-6411-46d2-48a6-433882eed5fb result: Mounting persistent disk: Getting real device path: Timed out getting real device path for ‘1ATA’

    Exit code 1

    Any hints gratefully accepted. I am investigating, but there could be any number of reasons why it didn’t work, including my adapting the various directory paths shown in the recipe. So, being a relative newbie to CF, I expect it will be difficult to isolate the cause.

  3. Immo Huneke says:

    It works when you downgrade / upgrade Virtualbox to 6.0.14 – the last version available in Homebrew before 6.1. There’s 6.0.22 available if you are maintaining your Virtualbox installation manually.
    brew cask uninstall virtualbox virtualbox-extension-pack
    cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
    git -C . fetch –unshallow
    git checkout 7e703e0466a463fe26ab4e253e28baa9c20d5f36
    HOMEBREW_NO_AUTO_UPDATE=1 brew cask install \
    virtualbox virtualbox-extension-pack
    git checkout HEAD

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 )

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.