CloudFoundry: PCF Dev for local development on Ubuntu

PCF Dev is a distribution of Cloud Foundry that has a minimal footprint and is designed to run locally on a developer’s machine.  Using this lightweight distribution of Cloud Foundry, a developer can debug and deploy applications locally.

In this article, we’ll go through the installation of PCF Dev on an Ubuntu development host.


First, you need at least 8Gb of system memory (with 16Gb recommended), and a minimum of 28Gb of disk (7Gb downloaded ova + 21Gb instantiated VM) plus the amount needed for each deployed app/service.

Then there are two component prerequisites, the CloudFoundry CLI tool and VirtualBox 5.0 or better.

Install CF CLI

Install the CF CLI which is a console based client application that communicates with the CF Cloud Controller.

$ wget -q -O - | sudo apt-key add -
$ echo "deb stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
$ sudo apt-get update
$ sudo apt-get install cf-cli

Verify the CLI version, which should look similar to below:

$ cf --version
cf version 6.31.0+b35df905d.2017-09-15

Install VirtualBox

See my article on installing VirtualBox on Ubuntu.

Install PCF Dev

With the prerequisites complete, now install the PCF Dev plugin available from Pivotal at

You will need a Pivotal account (which is free), and once signed up you can download the the Linux Version to your Ubuntu desktop (pcfdev-<VERSION> and then run the install as a normal user.

$ unzip
$ ./pcfdev-v0.28.0+PCF1.11.0-linux
Plugin successfully installed. Current version: 0.28.0. For more info run: cf dev help

Plugins get installed into $CF_HOME/.cf/plugins, which by default is $HOME/.cf/plugins.   Verify all your currently installed plugins:

$ cf plugins
Listing installed plugins...

plugin version command name command help
pcfdev 0.28.0 dev, pcfdev Control PCF Dev VMs running on your workstation

With the plugin now installed, you need to download and start the VM using ‘cf dev start’.  The instantiated VM by itself requires 20+Gb space, so if your $HOME directory does not have enough storage capacity, you should set the $PCFDEV_HOME environment variable explicitly (e.g. “export PCFDEV_HOME=/data/.pcfdev”).

When prompted, use the Pivotal credentials created earlier.

$ cf dev start
Please sign in with your Pivotal Network account.
Need an account? Join Pivotal Network:


Downloading VM...
Progress: |+++=================>| 100% 
VM downloaded.
Allocating 4096 MB out of 32046 MB total system memory (28405 MB free).
Importing VM...
Starting VM...
Provisioning VM...
Waiting for services to start...
7 out of 58 running
7 out of 58 running
7 out of 58 running
7 out of 58 running
40 out of 58 running
56 out of 58 running
58 out of 58 running
 _______ _______ _______ ______ _______ __ __
| || || | | | | || | | |
| _ || || ___| | _ || ___|| |_| |
| |_| || || |___ | | | || |___ | |
| ___|| _|| ___| | |_| || ___|| |
| | | |_ | | | || |___ | |
|___| |_______||___| |______| |_______| |___|
is now running.
To begin using PCF Dev, please run:
 cf login -a --skip-ssl-validation
Apps Manager URL:
Admin user => Email: admin / Password: admin
Regular user => Email: user / Password: pass

Then attempt to login to CF using the admin/admin credentials and selecting the pcfdev-org space:

$ cf login -a -o pcfdev-org --skip-ssl-validation
API endpoint:

Email> admin


Targeted org pcfdev-org

Targeted space pcfdev-space
API endpoint: (API version: 2.82.0)
User:           admin
Org:            pcfdev-org
Space:          pcfdev-space

You now have a local PCF Dev environment.  I would suggest you go through my article on deploying spring-music as your first CF application to test your deployment (be sure the API endpoint is set to ‘’).

After you push the deployment, you should be able to pull up a  browser view similar to the one below (but the URL will be https://spring-music-<word1>-<word2>


Offline DNS resolution of

The reason our browser can hit the API and applications at “*” is because of a little trick where a publicly available wildard DNS record  for always resolves to the IP address  And the local PCF Dev VM is hardcoded to the IP address by leveraging a host-only network.

But if you are doing local development, you might not be connected to a network.  You might be traveling on a plane, or at a customer site giving a demonstration.

This can be worked around by installing a local DNS server, on Ubuntu we can use dnsmasq.

$ sudo apt-get install dnsmasq

$ echo "address=/" | sudo tee /etc/dnsmasq.conf

$ sudo service dnsmasq restart

$ sudo netstat -plant | grep :53

Now if you modify “/etc/resolv.conf” so that it uses the local DNS server:


Then when you do an nslookup, you will see that resolution against the local server returns back an IP address of “”, which is the hard coded IP address of PCF Dev.

$ nslookup




REFERENCES (cf command reference) (default install locations) (dnsmasq for offline DNS resolution of * (dnsmasq on ubuntu) (dnsmasq reference) (behind proxy) (both-lite is another way for local development) (BOSH-lite and CF) (Micro Cloud VM from HPE is another way for local development)


SSH login to PCF Dev is user/pass: vcap/vcap

cf dev –help (start,stop,destroy,version)

nmap -A -T4 (scan PCF Dev for open ports)

If you get “getsockopt: connection refused” when trying to connect and can’t get a connection using telnet to, then the problem might be the VirtualBox host-only networking.  Check the network connections of the VM, the first adapter will be NAT, the second should be a host-only network with the specification  Also, I noticed that if you already have multiple host-only networks, this can be an issue.

$ vboxmanage list hostonlyifs | grep "^Name:"

I had success when I had only one vboxnet0 network, and PCF dev created and used vboxnet1 at  But I had issues when I already had vboxnet0 and vboxnet1, and PCF Dev was created vboxnet2.  I had to delete two of the host-only networks, then “cf dev delete”; then completely deploy again with “cf dev start” to get proper network connectivity.