docs/hosting/deploy-quick-start.md
import reflex as rx
So far, we have been running our apps locally on our own machines. But what if we want to share our apps with the world? This is where the hosting service comes in.
Reflex’s hosting service makes it easy to deploy your apps without worrying about configuring the infrastructure.
reflex>=0.6.6.reflex init and reflex run your app.requirements.txt file at the top level app directory that contains all your python dependencies! (To create a requirements.txt file, run pip freeze > requirements.txt.)First run the command below to login / signup to your Reflex Cloud account: (command line)
reflex login
You will be redirected to your browser where you can authenticate through Github or Gmail.
Open Deployments in the project sidebar. If the project has no deployments yet, select How to deploy. This page shows the available workflows: one-click deployment from the Builder, deployment from the CLI, and deployment to a cloud provider.
For the CLI workflow, copy the project-specific reflex deploy --project ... command.
rx.image(
src="https://web.reflex-assets.dev/docs-preview/hosting/how_to_deploy.webp",
alt="How to deploy page with Deployments selected and a project-specific Reflex CLI command",
class_name="rounded-md h-auto mb-4",
border=f"0.81px solid {rx.color('slate', 5)}",
)
Now you can start deploying your app.
From your project directory, where you normally run reflex run, run the command copied from the dashboard. It looks similar to:
reflex deploy --project 2a432b8f-2605-4753-####-####0cd1####
The command is by default interactive. It asks you a few questions for information required for the deployment.
requirements.txt to your python environment and if they are different then it will ask you if you want to update your requirements.txt or to continue with the current one. If they are identical this question will not appear. To create a requirements.txt file, run pip freeze > requirements.txt.That’s it! You should receive some feedback on the progress of your deployment and in a few minutes your app should be up. 🎉
For detailed information about the deploy command and its options, see the Deploy API Reference and the CLI Reference.
# Once your code is uploaded, the hosting service will start the deployment. After a complete upload, exiting from the command **does not** affect the deployment process. The command prints a message when you can safely close it without affecting the deployment.
If you go back to the Cloud UI you should be able to see your deployed app and other useful app information.
# Setup a Cloud Config File
To create a `config.yml` file for your app to set your app configuration check out the [Cloud Config Docs](/docs/hosting/config-file/).
# Moving around the Cloud UI
To go back, i.e. from an app to a project or from a project to your list of projects you just click the `REFLEX logo` in the top left corner of the page.
# All flag values are saved between runs
All your flag values, i.e. environment variables or regions or tokens, are saved between runs. This means that if you run a command and you pass a flag value, the next time you run the same command the flag value will be the same as the last time you ran it. This means you should only set the flag values again if you want to change them.