Deploy your first app
Get your Serverpod app live on Cloud in a few minutes.
Before you start
You need:
- The Serverpod Cloud CLI set up and authenticated. See Set up the Cloud CLI.
- A Serverpod project on your machine. See Creating a new project in the Serverpod installation guide.
Launch your project
From your project's root directory:
serverpod cloud launch
It creates a Cloud project and ships its first version in these steps:
- Choose the project. If your account has no projects, the command asks "Open the browser and create a new Serverpod Cloud project?" Press Enter to accept. If you already have projects, it lists them, with a last option to create a new project in the browser.
- Create the project in the Console. If you chose to create a new project, the Console's New project page opens. The project ID is pre-filled from your pubspec name (for example,
my-app), and the database is switched on if your server config has adatabasesection. Change either if you need to. Pick a plan (see Cloud plans), click Launch Project, and return to the terminal. The project ID becomes part of your default URL (<project-id>.serverpod.space). - Pre-deploy hooks. The command adds
serverpod generateas a pre-deploy hook, plusserverpod run flutter_buildif your server'spubspec.yamldefines that script. See Deployment hooks for details. - Custom passwords. If
config/passwords.yamlhas custom passwords, the command asks which ones to copy to Cloud. Passwords from theproductionandsharedsections are preselected. Set the rest later withserverpod cloud password set.
The command then writes a scloud.yaml linking subsequent commands to the project, uploads your code, and deploys.
Watch the deployment
The deployment runs in three stages. The terminal updates each one as it progresses:
Upload successful.
Cloud build successful.
Rollout successful. 🚀
When you see the rocket on Rollout, your app is live. The command then prints your project ID and the URLs your project is reachable at:
Your Serverpod Cloud project ID is: my-app
When the server has started, you can access it at:
Web: https://my-app.serverpod.space/
API: https://my-app.api.serverpod.space/
Insights: https://my-app.insights.serverpod.space/
Open your app
In your browser, open the Web URL the command printed:
https://my-app.serverpod.space/
Your Flutter web app loads at the root. If the app wasn't built before the upload, a Flutter web app not built page loads instead. Projects created with the website option show a landing page at the root, with the Flutter web app under /app.
What you've done
You've created a Cloud project and shipped its first version. From here:
- Every change you make ships with
serverpod cloud deploy. See Deployments for the full deploy lifecycle. - To use your own domain instead of
<project>.serverpod.space, see Custom domains.