Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/05-build-your-first-app/04-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ Serverpod Cloud is currently in private beta. Request access by [filling out thi

## Other deployment options

Check out [choosing a deployment strategy](../deployments/deployment-strategy) for more information on how to deploy your Serverpod application to other platforms.
Check out [Custom hosting](../08-deployments/custom-hosting/01-choosing-a-strategy.md) for more information on how to deploy your Serverpod application to other platforms.
34 changes: 34 additions & 0 deletions docs/08-deployments/01-deploy-to-serverpod-cloud.md
Comment thread
developerjamiu marked this conversation as resolved.
Comment thread
Swiftaxe marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
sidebar_label: Deploy to Serverpod Cloud
sidebar_class_name: sidebar-icon-deploy-to-cloud
description: Deploy your Serverpod Flutter backend to Serverpod Cloud in minutes, with zero configuration and a managed database, TLS, and scaling.
---

# Deploy to Serverpod Cloud

[Serverpod Cloud](/cloud) is the recommended way to host a Serverpod server. It is a fully managed platform built and maintained by the Serverpod team, designed specifically for Serverpod apps. You deploy in minutes with zero configuration, and there is no VM setup, container configuration, or infrastructure to orchestrate yourself.

:::info

Your first project includes a one-month free trial, with no credit card required.

:::

Cloud manages the production infrastructure for you:

- An optional production-grade Postgres database, with migrations applied automatically on each deploy.
- Networking, load balancing, and custom domains with TLS certificates.
- Automatic scaling to any size, with predictable pricing.
- A secure key manager for your app secrets.

## Deploy from the terminal

You deploy with the `scloud` CLI:

1. Install the `scloud` CLI.
2. Run `scloud launch`. It creates the Cloud project, provisions a database if you enable one, and deploys your server.
3. Set any app secrets (API keys, OAuth credentials) with `scloud password set`.

See the [Serverpod Cloud documentation](/cloud) for the full walkthrough, including secrets, custom domains, and logs.

To run the server yourself instead, see [Custom hosting](./custom-hosting/01-choosing-a-strategy.md).
52 changes: 0 additions & 52 deletions docs/08-deployments/01-deployment-strategy.md

This file was deleted.

53 changes: 53 additions & 0 deletions docs/08-deployments/custom-hosting/01-choosing-a-strategy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
sidebar_label: Choosing a strategy
description: Choose how to self-host a Serverpod server, on a server cluster, a serverless platform, or your own machine, as an alternative to Serverpod Cloud.
---

# Choosing a strategy

You can run a Serverpod server anywhere that supports a Dart process or a Docker container: a managed server cluster, a serverless platform, or your own machine. This page covers the trade-offs, and the following pages walk through each path. For the managed path, see [Serverpod Cloud](/cloud).

## Server cluster or serverless?

The two main options are running on a cluster of servers or on a serverless platform. Run on a **cluster** (such as Google Cloud Engine) if your server holds state. Run **serverless** (such as Google Cloud Run) if your server is stateless. An example of a stateful server is [Pixorama](https://pixorama.live), where the server keeps live state in memory. If you only make API calls that read and write a database, serverless may be the better fit.

| | Server cluster | Serverless |
| :--- | :---------------------------------------------------------------------------------------- | :------------------------------------------------------------------ |
| Pros | All features are supported. Great for real-time communication. Cost-efficient at scale. | Minimal starting cost. Easier configuration. Minimal maintenance. |
| Cons | Slightly higher starting cost. More complex to set up. | Limited feature set. The server cannot hold state. |

Serverless does not support:

- Future calls. (Possible to configure, but requires a more advanced setup.)
- Health metrics.
- On-server caching. Caching can still happen while a serverless instance stays warm, but it can be lost at any time. Caching with Redis is supported.
- In-memory state. Store shared state in an external service such as Postgres, Redis, or another API instead.

## Pick a guide
Comment thread
Swiftaxe marked this conversation as resolved.

- [Google Cloud Engine with Terraform](./02-google-cloud-engine-terraform.md): server cluster on GCP.
- [Google Cloud Run with GCP Console](./03-google-cloud-run-console.md): serverless on GCP.
- [AWS EC2 with Terraform](./04-aws-ec2-terraform.md): server cluster on AWS.
- [Hosting elsewhere](./05-hosting-elsewhere.md): run Serverpod on any Dart or Docker host.
- [Community-supported deployments](./06-community-supported.md): tools built by the community.

## Approximate costs

A minimal **server cluster** on Google Cloud Platform:

| Service | Min cost |
| :----------------------- | :------- |
| Compute Engine Instance | $7 / mo |
| Cloud Load Balancing | $19 / mo |
| Cloud SQL for PostgreSQL | $10 / mo |

A minimal **serverless** setup on Google Cloud Run, where you only pay for the traffic you serve and no load balancer is required:

| Service | Min cost |
| :----------------------- | :------- |
| Cloud Run | $0 / mo |
| Cloud SQL for PostgreSQL | $10 / mo |

:::info
These prices are rough approximations to give you a sense of hosting costs. Actual costs vary and change over time. Do your own research before provisioning infrastructure.
:::
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google Cloud Engine with Terraform

Serverpod makes deploying your server to Cloud Engine easy using Github, Terraform, and Docker containers. Terraform will set up and manage your infrastructure while you use Github to build your Docker container and manage versions and deployments. Creating your project using `serverpod create` will automatically generate your deployment scripts. The default setup creates a minimal configuration, but you can easily modify the configuration to suit your needs.
Serverpod can be deployed to Cloud Engine using Github, Terraform, and Docker containers. Terraform sets up and manages your infrastructure while you use Github to build your Docker container and manage versions and deployments. The default setup creates a minimal configuration, but you can modify it to suit your needs.

:::caution

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Google Cloud Run with GCP Console

If your server does not maintain a state and you aren't using future calls, running your Serverpod on Google Cloud Run can be a great option. Cloud Run is the easiest way to deploy your server but may be less flexible as your application grows. Check the [Choosing deployment strategy](deployment-strategy) page for more information on choosing the best solution for your needs.
If your server does not maintain a state and you aren't using future calls, running your Serverpod on Google Cloud Run can be a great option. Cloud Run is the easiest way to deploy your server but may be less flexible as your application grows. See [Choosing a strategy](./01-choosing-a-strategy.md) for more on choosing the best solution for your needs.

## Before you begin

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# AWS EC2 with Terraform

Serverpod makes it easy to deploy your server to AWS using Github and Terraform. Terraform will set up and manage your infrastructure while you use Github actions to manage versions and deployments. Creating your project using `serverpod create` Serverpod will automatically generate your deployment scripts. The default setup uses a minimal configuration that will fit within the AWS free tier, but you can easily modify the configuration to suit your needs.
Serverpod can be deployed to AWS using Github and Terraform. Terraform sets up and manages your infrastructure while you use Github actions to manage versions and deployments. The default setup uses a minimal configuration that fits within the AWS free tier, but you can modify it to suit your needs.

:::caution

Expand Down
5 changes: 5 additions & 0 deletions docs/08-deployments/custom-hosting/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"label": "Custom hosting",
"position": 2,
"className": "sidebar-icon-custom-hosting"
}
10 changes: 10 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,16 @@ a.navbar__link svg use[href="#theme-svg-external-link"] {
--sidebar-icon-color: currentColor;
}

.theme-doc-sidebar-menu .sidebar-icon-deploy-to-cloud .menu__link {
--sidebar-icon-mask: url('/img/sidebar-icon-cloud-sun.svg');
--sidebar-icon-color: currentColor;
}

.theme-doc-sidebar-menu .sidebar-icon-custom-hosting > div.menu__list-item-collapsible > a.menu__link--sublist {
--sidebar-icon-mask: url('/img/sidebar-icon-server.svg');
--sidebar-icon-color: currentColor;
}

.theme-doc-sidebar-menu .sidebar-mobile-product-switch.sidebar-icon-serverpod-cloud,
.theme-doc-sidebar-menu .sidebar-mobile-product-switch.sidebar-icon-serverpod-cloud .menu__link {
--sidebar-icon-mask: url('/img/sidebar-icon-cloud-sun.svg');
Expand Down
1 change: 1 addition & 0 deletions static/img/sidebar-icon-server.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading