Disclaimer: IBM Cloud Tools for Swift (ICT) is no longer supported. Check out IBM Cloud App Service to take advantage of the same features of ICT in a more comprehensive experience for building Cloud Native applications in any programming language.


6 Steps to Deploying a Swift To-Do List Sample App Without A Command Line

IBM Cloud Tools for Swift (ICT) provides Mac users with a simple interface for deploying, managing and monitoring end-to-end Swift applications. The application integrates with tools designed by IBM Swift Engineers to easily get started writing Swift on the Server. Download the Beta version of ICT to your Mac.

A previous post showed how to set up a To-Do list using Kitura, a lightweight web framework that allows you to easily build web services with complex routes. Below, I will walk through how to deploy that To-Do List to IBM Cloud, using ICT instead of a Command Line Interface. ICT offers many benefits you typically wouldn’t get by deploying through a CLI. It allows you to easily organize your Projects by grouping related client-side and server-side code written in Swift; deploy the server-side code to IBM Cloud with one simple click; then monitor and manage your Projects through Mac’s native notifications, even when not actively using the application.

1. Download the application and get a IBM Cloud account

Download the Beta version to your Mac.

Before using the app, you will need to create and sign in to your IBM Cloud account. IBM Cloud provides a platform where you can host applications and integrate services for these applications. If you do not have an IBM ID, sign up for one and get started with your free 30-day trial. To learn more about what IBM Cloud offers, click here.


After creating an account, log in to IBM Cloud to set up your Org and Spaces. Orgs are for accounting purposes. If you belong to your business’s larger Org, your account will be paid for and managed by them. Spaces are areas for organizing shared IBM Cloud applications within your Org. You may want to set up a test space to easily distinguish between test Projects and Projects in production. You will also notice that IBM Cloud asks for your region. IBM Cloud servers sit across the globe to optimize your application. Early versions of ICT only support US South, so select US South as your region in order to use our application. Future versions will support other regions. To sum up, your Cloud Runtime will belong to a Space within your Org running on servers in the US South region.

2. Download the Kitura To-Do List Sample App

Clone the Kitura To-Do List onto your machine. Use this URL to git clone: https://github.com/IBM-Swift/todolist-couchdb.git

3. Create a Kitura Project

Open ICT. From the Projects view within the application, click the blue “+” icon in the upper right hand corner.


Select Create Kitura Project.


Enter a Project Name and click Create Kitura Project.


Enter a Cloud Runtime Name. This will generate a Cloud Runtime URL on IBM Cloud. Select the space where you would like to deploy. Click Next.


Choose a location to save your files.


You will see a loading screen signifying that ICT is cloning the Kitura Buildpack to your computer, deploying and compiling the code to IBM Cloud, then running the Project on the server. It may take 5-7 minutes for ICT to do this for you in the background.

4. Create a Cloudant service

Click here to launch the IBM Cloud website and sign in.


Navigate to your dashboard then click Work With Data under Data & Analytics.


Select New Service.


Choose Cloudant NoSQL DB under Full-Service.


Click Choose Cloudant NoSQL DB on the next page to get started.


Under Add Service, choose the space where you created your Cloud Runtime. Under App, choose your Cloud Runtime name. If your Cloud Runtime is not an option, the application either needs more time to start it ,or there was an error. ICT will notify you once it’s running or if an error occurred causing it to stop.

Under Service name, type “TodoList-Cloudant”. The service name needs to be exactly that or the program will not run successfully. Then click Create.


Click Restage on the following screen.


On the left hand column under your Cloud Runtime name, you’ll see Cloudant NoSQL DB under Services. Click it to see the view then click launch in the upper right hand corner of the screen.


Select Create Database and name it “todolist”. Then click Create.


Select the “+” icon next to All Documents then choose New View.


This view will be called “example”. The Index name should be “all_todos” and paste the following function in the Map function:

function (doc) {
    if (doc.type == 'todo' && doc.active) {
    emit(doc._id, [doc.title, doc.completed, doc.order]);

Reduce should be none.

Click Create Document and Build Index.


Click the “+” icon next to example and select new view.


The Index name should be “total_todos” and paste the following function in Map function:

function (doc) {
    if (doc.type == 'todo' && doc.active) {
    emit(doc._id, 1);

Reduce should be _count.


Now you have your Cloudant service set up to run the to-do list.

5. Deploy the Kitura To-Do List

Now you must move the cloned Kitura To-Do List files into your Project folder. Do this by using Finder to copy all of the contents of the cloned ToDo List, then pasting it within your Project folder where ICT saved the Kitura Buildpack. You will need to replace all of the Kitura Buildpack files with the To-Do List files because the manifest.yml, Package.swift, Procfile, and Source files are all customized for the To-Do List. For more information on how these files were created, visit the Kitura To-Do List tutorial by clicking here.

Deploy the updated files to IBM Cloud by clicking the deploy icon (signified by a cloud with an arrow going into it).


6. It works!

Navigate to:
http://www.todobackend.com/client/index.html?https://[Your Cloud Runtime Name].mybluemix.net/

Todobackend.com is acting as the client-side of the application, pointing to the server-side code you deployed in the last step. If you navigate to your Cloud Runtime URL, you will see a version that is not stylized.

Don’t be surprised if the deployment isn’t immediate. In the background, the application is installing and uploading items to make the process work. In some situations, the Beta version takes up to 10 minutes to deploy. We are actively working on reducing that time for our users.

Type to-do items then refresh the page to prove that your Cloudant Service saved the items. Or, you can navigate to your all_todos view within the Cloudant database to see your items.



If you have questions along the way, reach out to us through dWAnswers. We are actively working on improving the experience of adding existing Swift on the Server files. If you would like to give feedback for future enhancements, fill out our survey.

To learn more about how to get started, check out our demo. You can visit the Swift@IBM website to view even more demos about Swift initiatives. If you’re new to Swift on the Server, check out our Sandbox to start learning now.

8 comments on"6 Steps to Deploying a Swift To-Do List Sample App Without A Command Line"

  1. […] Tutorial: Deploying a Swift to-do list app to the cloud (Emma Tucker) […]

  2. Emma Tucker thank you for taking the time to put together this article. I’m running into some trouble deploying the app using the steps outlined above.

    The Bluemix console is reporting the following:

    —–> Installing Swift DEVELOPMENT-SNAPSHOT-2016-06-20-a
    Staging failed: Buildpack compilation step failed

    I’m wondering what version of the toolchain was used when you tried this last, and if there is a recommended commit I could check out to make sure I can follow the steps above.

  3. I was using https://github.com/IBM-Swift/TodoList-CouchDB, commit [c8246f2]. I tried again on the current commit [2c3ca1a], and am getting a little further, but it looks like the app is crashing.

    App instance exited with guid fd8edfed-foo-bar-baz payload: {“cc_partition”=>”default”, “droplet”=>”fd8edfed-foo-bar-baz”, “version”=>”3419b26a-foo-bar-baz”, “instance”=>”ef481ffoobarbaz”, “index”=>0, “reason”=>”CRASHED”, “exit_status”=>255, “exit_description”=>”app instance exited”, “crash_timestamp”=>1469652231}

    The link you supplied in the comment above points to commit [12392d0]. When I checked out that commit and tried it, I received the following error while trying to deploy:

    swift-build: error: The dependency graph could not be satisfied (https://github.com/IBM-Swift/Kitura.git)

    • Hi, yesterday we discovered what should be the issue and hope to release that fix today or tomorrow. Thank you for bringing this to our attention!

  4. it never starts “App staging failed in the buildpack compile phase”

    • Hi, thank you for the comment. We will hopefully have this fixed within the tool today or tomorrow.

Join The Discussion

Your email address will not be published. Required fields are marked *