Cloud Providers
You can deploy the built Wasp app wherever and however you want, as long as your provider/server supports running a Node.js server (or a Docker container) and a PostgreSQL database.
Guides
We have step-by-step guides for deploying your Wasp app to some of the most popular providers you can follow:
Deploying Wasp to Fly.io »
Uses Fly.io, fly CLI, Docker
Deploying Wasp to Heroku »
Uses Heroku, heroku CLI, Docker
Deploying Wasp to Railway »
Uses Railway, Railway CLI
Deploying Wasp on Render »
Uses Render, Blueprint (IaC)
If your desired provider isn't on the list, no worries, you can still deploy your app - it just means we don't yet have a step-by-step guide for you to follow. Feel free to open a PR if you'd like to write one yourself :)
Manual deployment
Deploying a Wasp app comes down to the following:
- Generating deployable code.
- Deploying the app.
- Deploying a PostgreSQL database and keeping it running.
Let's go through each of these steps.
1. Generating Deployable Code
Running the command wasp build generates deployable code for the whole app in the .wasp/out/ directory.
wasp build
You won't be able to build the app if you are using SQLite as a database (which is the default database). You'll have to switch to PostgreSQL before deploying to production.
2. Deploying the App
There's a Dockerfile in the .wasp/out directory that defines an image containing your whole app: your pages, your assets, and your API.
Your app's pages and assets are built together with the rest of your app, inside the Docker image. That is also where your client env variables have to be, since their values end up inside the built files.
You pass them to the build with the WASP_CLIENT_ENV build argument, as shell assignments, one per line:
docker build \
--build-arg WASP_CLIENT_ENV="REACT_APP_SOME_VAR_NAME='somevalue'" \
-t my-wasp-app \
.wasp/out
If your app doesn't have any client env variables, you can leave the argument out.
To run your app in production, deploy this Docker image to a hosting provider and make sure the required env variables are correctly set up. Usually, you use the provider's dashboard UI or a CLI tool to set up these env variables.
Check the required server env variables and make sure they are set up for your app.
Your app listens on the port given to it as PORT, and answers health checks on /_wasp/health.
While these are the general instructions on deploying anywhere, we also have more detailed instructions for chosen providers below, so check that out for more guidance if you are deploying to one of those providers.
3. Deploying the Database
Any PostgreSQL database will do, as long as you provide your app with the correct DATABASE_URL env var and ensure that the database is accessible from it.