Deploying to Vapor Cloud 2 Tutorial

Learn how to deploy your Vapor app to Vapor Cloud 2, and take advantage of the free database tier in the new version of their cloud service! By Joe Howard.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 3 of 3 of this article. Click here to view the first page.

Deploying the Vapor Cloud App

To start the deployment, click the Deploy button on the Git card:

Use the Default Branch and click Deploy:

Be sure to note the comment on the deploy card that “Deployments usually take around 10 minutes to complete. They cannot be canceled.” Time for a celebratory drink or a brisk walk around the block!

While you’re celebrating, your app will build and be deployed to Vapor Cloud:

Upon your return, at the bottom of the window, you’ll see:

-----> Released v4
Pushed to Vapor Cloud on YOUR_APP_SLUG.v2.vapor.cloud
Job done: closing logs.
Activity closed, goodbye.
-----> Connection to logs closed

Bringing the App Online

With the app deployed for the first time, you must use one or more replicas to scale the app. You will not need to scale on subsequent deployments.

Click Scale on the web Replica card, then change 0 to 1, and click Scale:

Once the scaling is done, point your browser at YOUR_APP_SLUG.v2.vapor.cloud.

You’ve just deployed your first Vapor app to Vapor Cloud 2!

Where to Go From Here?

You’ve seen how easy it is to host your Vapor app on Vapor Cloud 2. You learned how to set up the app using the Vapor Cloud 2 console, configure your Git repository, add the necessary configuration values to your application, and deploy your app.

You can learn much more about deploying to Vapor Cloud 2 in the official docs.

Remember that, at the time of writing this tutorial, Vapor Cloud 2 is still in pre-release, so be sure to follow its development schedule before you start hosting production apps on the service.

You’ll also want to learn about other deployment options for Vapor apps, such as Heroku. You can read about these other options in our book, Server Side Swift with Vapor, that covers everything you need to know to get started developing and deploying Vapor APIs and web apps.

Feel free to add comments or questions in the forum below!