Deploying to the Cloud

Kitura is built to be Cloud-ready.

We provide a simple starter project that demonstrates deployment to Bluemix, plus a macOS desktop application to aid integration with Xcode.

Additionally, you can use our pre-built Docker image to guide you on how to deploy a container-based Kitura application.


Pushing your application to Bluemix will build your application using the latest Swift version supported by the buildpack, which changes periodically. Adding a .swift-version to your application is a common convention to specify the version of Swift needed for your application.


Add a .swift-version file with the desired version or snapshot of Swift

echo "3.1" > .swift-version

Kitura-Starter

Kitura-Starter is a Kitura based server application that you can use as a starting point to get your own Kitura application up and running on Bluemix. After cloning this GitHub repo to your local system, you can deploy this application to Bluemix right away.

Once you have the Bluemix command line tool installed, deploying to the cloud is as simple as bx app push.


IBM Cloud Application Tools

IBM Cloud Application Tools radically simplifies the management and deployment of server-side assets. It helps improve productivity by complimenting a developer’s familiar Xcode environment.

Swift developers can extend their mobile apps and connect them to IBM Bluemix with a local development environment. Now, every Swift developer can more easily begin to deploy cloud services.

Visit cloudtools.bluemix.net to learn more about this free macOS app.


Docker

We provide a pre-built Docker image containing the latest release of Kitura. Follow these steps to try it out.

Install Docker on your development system.

Pull down the kitura-ubuntu image from Docker Hub:

$ docker pull ibmcom/kitura-ubuntu:latest

Create a Docker container to build and run the kitura-ubuntu image you just downloaded and forward port 8080 on host to the container:

$ docker run -i -p 8080:8080 -t ibmcom/kitura-ubuntu:latest

You should see an output message similar to the following:

[2017-04-03T18:22:47.146Z] [INFO] [main.swift:28 Kitura_Starter] Server will be started on 'http://localhost:8080'.
[2017-04-03T18:22:47.222Z] [INFO] [HTTPServer.swift:104 listen(on:)] Listening on port 8080

Visit http://localhost:8080/ in your web browser.