Deploying to the Cloud
Kitura is built to be Cloud-ready.
We provide a simple starter project that demonstrates deployment to IBM Cloud.
Additionally, you can use our pre-built Docker image to guide you on how to deploy a container-based Kitura application.
Specify a version of Swift (optional, but extremely recommended)
Pushing your application to IBM Cloud 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 "4.0.3" > .swift-version
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 IBM Cloud. After cloning this GitHub repo to your local system, you can deploy this application to IBM Cloud right away.
Once you have the IBM Cloud command line tool installed, deploying to the cloud is as simple as
bx app push.
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
http://localhost:8080/ in your web browser.