Skip to content

Quick Start

This guide will walk you through all of the required steps for deploying your first app in Vapor Cloud 2.

Signup

To get started on Vapor Cloud 2, setup a new account here.

Signup

After you have created your account, and signed in, you will see something like this:

Dashboard

Note

During the Alpha, you will see various parts of the dashboard as "Under construction".

Setup Git Access

Git keys give you access to Vapor Cloud's private Git server. To setup git keys, you need to get the contents of your public SSH file. It's usually located at ~/.ssh/id_rsa.pub, but my vary.

To get the content you can run the following command:

cat ~/.ssh/id_rsa.pub

Alternately on macOS you can get the content of the key directly on your clipboard:

pbcopy < ~/.ssh/id_rsa.pub

It's only one line. Copy the entire output.

Next, in the dashboard, navigate to the Settings page using the main menu. Then, click the + button in the SSH keys section.

Setup key

Give your SSH key a recognizable name and paste the contents of the key. Then, click create.

Note

This might take a few seconds to create.

After this you should be able to verify access by running.

ssh git@git.code.vapor.cloud

The output will look something like this:

PTY allocation request failed on channel 0
Hi jonas@vapor.codes, You've successfully authenticated to Vapor Cloud Git
 R W    night-long-14474
 R W    sun-ancient-43997
Connection to git.code.vapor.cloud closed.

For more info and troubleshooting, please see the Git basics page

Prepare your Project

In order to run on Vapor Cloud, a project needs to define a web.Dockerfile. This is responsible for building the project and finally booting a server to handle HTTP requests on port 80.

We offer a growing collection of Dockerfile templates for various web frameworks at vapor-cloud/docker. If the framework you are deploying is there, just copy the web.Dockerfile into your project and commit it.

You can always create your own web.Dockerfile if you want. Visit Docker → Basics for more information.

New Application

Next, we need to create a new application in Vapor Cloud to host our project. Go to the Applications page using the main menu, then click the + icon to create a new application.

Create application

For Name, let's let Vapor Cloud generate a unique name for our application by selecting Generated. Choose a plan and region to host your application in, then click create.

You can now see your application:

See application

Click the "More" icon on the Git card, and view the instructions for configuring Git.

Deploy

After you have pushed your code to Vapor Cloud's private git server, you can start the deployment. Click the Deploy button on the Git card. By default the deployment will use the environment's Default Branch (master). If you want to deploy another branch, you can select Custom Branch, or create a new environment.

When you start the deployment, you automatically get all output from the deploy, making debugging easy. The last part of the deploy is Launching. This will wait until the application is online. If booting the app fails, you will get the log output so you can see what failed.

Deploy

Scale

After deploying your app for the first time, you must scale the application to one or more replicas to bring it online. Subsequent deployments will not require you to re-scale your application.

On the Replica card, click scale, and scale your app to 1.

Scale

After this you should be able to access your application on <app-slug>.v2.vapor.cloud

Note

During Alpha apps will be available on v2.vapor.cloud we will be switching to vapor.cloud during Alpha

Note

As we do have limited resources during Alpha, we advice you to keep your replicas small, if possible try to keep them at the free plan.

Free plans in Cloud 2 provides 64mb memory, which should be enough for most use cases.