Deploy your app
Your recipe app runs locally. The last step is to put it online. The recommended path is Serverpod Cloud, which hosts your server and database with zero configuration.
Deploy to Serverpod Cloud
From your project's root folder, run:
$ serverpod cloud launch
The command walks you through these steps:
- If the Serverpod Cloud CLI isn't installed yet,
serverpod cloudinstalls it first. - If you aren't signed in, your browser opens so you can sign in.
- For a new project, the Cloud Console opens so you can create it. Keep the database enabled there, because the recipe app stores its recipes in it. Cloud provisions a managed Postgres database, separate from the embedded one
serverpod startruns locally. - You choose which custom passwords from
config/passwords.yamlto copy to Cloud. That file stays on your machine and is never deployed. SelectgeminiApiKeyso the deployed server can call Gemini. It isn't selected by default, because it sits in thedevelopmentsection. - The command deploys your server along with the web build of your app.
The first upload includes your Flutter web build and can exceed the default timeout on a slower connection. If the upload times out, retry with a higher limit, for example, serverpod cloud launch --timeout 600s.
If you didn't select geminiApiKey, set the key as a secret. Then redeploy so the server picks it up:
$ serverpod cloud password set geminiApiKey "your-gemini-api-key"
$ serverpod cloud deploy
Whenever you make changes later, redeploy with:
$ serverpod cloud deploy
See the Serverpod Cloud documentation for the full walkthrough, including custom domains, logs, and your free trial.
Other deployment options
Prefer to host the server yourself? See Custom hosting for running on a server cluster, a serverless platform, or your own machine.
What you've built
You've built and deployed a full-stack app with Flutter and Serverpod:
- A custom endpoint that calls an external API from the server.
- A type-safe data model shared between the server and the Flutter app.
- Persistent storage with the database.
- A Flutter app that talks to your server through the generated client.
We're excited to see what you'll build next. If you need help, join the Discord community or ask in our community on GitHub. To go deeper into any topic, browse the Concepts section.