Skip to Content
Author's profile photo Steffen Froehlich

Cloud Platform – Server Side Swift Applications with Cloud Foundry

This is an end-to-end introduction, how to run a swift application on Cloud Foundry stack within SAP Cloud Platform.



  1. Prerequisites
  2. Clone Sample App
  3. Push Application to SCP – CloudFroundry
  4. Modify iOS app to connect to CF instance


– CocoaPods: (I recommend to install it in user directory via following bash command:
gem install cocoapods --user-install
echo 'export PATH=$PATH:$HOME/.gem/ruby/2.3.0/bin'

Clone Sample App

IBM has provided a backend sample app for the popular iOS App “FoodTracker” by Apple.
git clone
You can now walk through of the tutorial or directly check out the branch “CompletedFoodTracker”.

Push Application to SCP – CloudFroundry 

Once the server application successfully runs locally you can push it to you Cloud Foundry instance.
Unfortunately, the swift-buildpack in the `manifest.yml` file points to a service, which doesn’t exist in SCP Cloud Foundry environment, yet. Therefor, we have to change the buildpack to the github repo provided by IBM. It seems that the CF community buildpack is no longer maintained.
Which buildpacks are available, can be found out with following command: cf marketplace
Modify file .swift-version of the FoodTracker server to meet the version in the buildpack:
Create the file Procfile in Foodserver folder, with following content, that CF knows what should be started after an successful upload:
web: FoodServer
Now the server application can be pushed to
cf api
cf login
cf push foodserver​
In the output you’ll see for the routes output, under which URL your app is deployed and reachable.
It’s something like:
The route name is created dynamically, see manifest.yml file…

Modify iOS app to connect to CF instance

To communicate with FoodTracker-server via iOS app just replace the baseURL, used for creation the KituraKit class:
guard let client = KituraKit(baseURL: "")
In a next blog I’ll show you how to extend this server side Swift app with a real database.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Dominique Pierre
      Dominique Pierre

      Thanks for this blog Steffen, investigate server-side Swift on SCP is on my todo list.



      Author's profile photo Jörg Rustler
      Jörg Rustler

      Thanks for the blog. I'm really interested getting to know more about server side swift on SCP.