Documentation
Deploying to Production

Deploying to Production

When you're ready to deploy your app to production, create a .env file at the root of your project, fill it in with all the environment variables specific to your production environment, and run the following commands in your terminal (at the root of your project):

npx sst secret load .env --stage production
npx sst deploy --stage production

This command will take a few minutes as it’ll deploy your app to a completely new environment called production.

💡

Note that production is a reserved environment name. You could also deploy to any other environment name, like staging or develop, but note, that the domain structure is set up in such a way that production is considered the real production environment. See our guide on subdomnain structure for more info.

Apply for production usage at external services

Most authentication providers require you to apply your project separately for production usage. Follow the respective provider's documentation (opens in a new tab) to apply for production usage.

Also, your AWS SES account will need to be verified for production usage, as it is currently still in sandbox mode. Follow this guide to apply for production usage.

Custom domains

If you have not purchased a custom domain yet, your infrastructure will be deployed to random AWS domains like the following:

https://d3j4c16hczgtjw.cloudfront.net

To set up custom domains, please follow our guide on custom domains.

CI/CD

There are many common CI/CD services, like GitHub Actions (opens in a new tab) or Travis CI (opens in a new tab). These usually require you to manually configure a pipeline. It involves a fair bit of scripts and configuration.

To automate deployments for SST apps, it's recommended to use SST's autodeploy feature. You can check out how to set that up here (opens in a new tab)