web/versioned_docs/version-0.23/deployment/deployment-methods/self-hosted.md
import { ImgWithCaption } from '@site/blog/components/ImgWithCaption' import { GuideLink } from '@site/src/components/GuideLink'
If you have your server or rent out a server, you can self-host your Wasp apps. Self-hosting your apps gives you full control over your apps and their data. It can be more cost-effective than a cloud provider since you can deploy multiple apps on a single server. However, you'll need to manage the server yourself, which can be time-consuming and require some technical knowledge.
We have step-by-step guides for deploying your Wasp app on your server with different methods. Check out the guides below:
<GuideLink linkToGuide="../../guides/deployment/vps" title="Deploying Wasp with Docker on your server" description="Uses Ubuntu, Git, Caddy, Docker" /> <GuideLink linkToGuide="../../guides/deployment/coolify" title="Deploying Wasp with Coolify on your server" description="Uses Coolify, Github Actions, Github Container Registry" /> <GuideLink linkToGuide="../../guides/deployment/caprover" title="Deploying Wasp with Caprover on your server" description="Uses Caprover, Github Actions, Github Container Registry" />We will show you a general overview of the architecture of a self-hosted Wasp app and the steps you need to take to deploy your app on your server. This is a more manual process than using the guides above, but it gives you more control over your deployment and you'll learn how everything works. If you are looking for a more guided deployment, check out the guides above.
To successfully self-host your Wasp app, you need to have the following:
A server with a public IP address. There are many cloud providers you can use to rent a server. Some popular ones are AWS, DigitalOcean, OVH, and Hetzner.
A domain name, for example, myapp.com (needed for HTTPS support).
To self-host your Wasp app, you'll follow these general steps:
wasp build.Dockerfile in the .wasp/out directory that you can use to build and run the server app.Dockerfile..env file or by passing the env variables directly to the docker run command..wasp/out/web-app directory.myapp.com for the client and api.myapp.com for the server.myapp.com and proxy requests to the server app on api.myapp.com. Make sure your env variables are using these client and server URLs.By default, our self-hosted deployment methods run the database on your server. When you run the database on your server, you need to take care of backups, updates, and scaling. We suggest setting up PostgresSQL periodic backups and/or taking snapshots of your server's disk. In case something bad happens to your server, you can restore your database from the backups.
If you prefer not to manage the database yourself, you can use a managed database service. The service provider takes care of backups, updates, and scaling for you but it can be more expensive than running the database on your server. Some popular managed database services are AWS RDS, DigitalOcean Managed Databases, and Supabase.