> As of Next.js@16.2.1 turbopack is broken ant it spikes CPU usage by 900% and 8-9GiB of RAM usage, thus why we use webpack. Wait for 16.3.0 to migrate to turbopack
[Source of truth](https://github.com/get-convex/convex-backend/blob/main/self-hosted/README.md)
1. Go on Coolify, search for Convex and set it up.
> [!IMPORTANT]
> Best case: [copy config from here](https://github.com/get-convex/convex-backend/blob/main/self-hosted/docker/docker-compose.yml), paste it instead of Coolify's docker-compose file, then go into environment variables, copy them, paste them and the new docker-compose into an AI agent and tell him to properly map the envs to docker-compose so it's ready to deploy on coolify.
This works for Convex 1.34.0 (CLI+backend/dashboard)
Then make sure to update domains and env vars accordingly
2. Deploy the service(s - dashboard and the db). It has built-in persistent storage
3. Connect to server with ssh, jump into a **backend** container with `docker exec -it <name> ./generate_admin_key.sh`
You'll receive Your admin key and You'll be able to log into dashboard
```
Admin key:
self-hosted-convex|010...
```
4. Now Your base is ready. Go to .env.local and finish setting up the connection.
5. Run `npm install` (only if Your image is latest, else use a proper version)
6. After that You can run `npx convex dev` and You should be ready to go!
7. Time to pick a theme! Go to [shadcn/create](https://ui.shadcn.com/create), create a theme, and simply use the received command to init this theme in Your project!
#### Troubleshooting
```
dev/templates/convex-next-saas main !? ❯ npx convex dev
✖ Error: Unable to start push to https://backend-i8e44nvzhj8sxw4qm9tbu1f7.mentat.ovh
✖ Error fetching POST https://backend-i8e44nvzhj8sxw4qm9tbu1f7.mentat.ovh/api/deploy2/start_push 400 Bad Request: BadJsonBody: Failed to deserialize the JSON body into th
e target type: appDefinition: missing field `functions` at line 1 column 272745
```
**Solution** - ensure both CLI and convex self-hosted cloud images versions are the same. If not - I suggest upgrading whatever version is lower to be higher.