Coolify
Last checked with Wasp 0.26 and Coolify (as of Jan 30, 2026).
This guide depends on external libraries or services, so it may become outdated over time. We do our best to keep it up to date, but make sure to check their documentation for any changes.Deploy Wasp with Coolify
This guide shows you how to deploy a Wasp application to Coolify, a self-hosted deployment platform that makes managing your infrastructure easy.
Prerequisites
- A server with Coolify installed
- A domain name
- A GitHub repository with your Wasp application
Overview
Deploying to Coolify involves:
- Creating Coolify resources (the app and the database)
- Building the Docker image using GitHub Actions
- Triggering Coolify to pull and deploy the image
wasp build gives you a single Docker image that contains your whole app: its pages, its static assets, its API and its websockets. That is why there is one app in Coolify, not one for the client and one for the server.
Step 1: Set Up Your Domain
Point your DNS A record to your server IP:
@(root) → server IP (formyapp.com)
Step 2: Create Coolify Resources
Create the Database
- Create a new resource and select PostgreSQL
- Use the default PostgreSQL variant
- Name it
myapp-db - Click Start to set up the database
- Copy the Postgres URL (internal) - you'll need this later
Create the App
- Create a new resource and select Docker Image
- Set the image name to
ghcr.io/<your-github-username>/myapp - Name it
myapp - Configure:
- Domains:
https://<your-domain> - Docker Image Tag:
main - Port Exposes:
3001
- Domains:
- Click Save
Step 3: Configure Environment Variables
In the app, go to Environment Variables and add:
| Variable | Value |
|---|---|
DATABASE_URL | The Postgres URL (internal) from step 2 |
JWT_SECRET | Random string at least 32 characters long: |
PORT | 3001 |
WASP_SERVER_URL | https://<your-domain> |
Add any other environment variables your app needs (from .env.server).
WASP_WEB_CLIENT_URL defaults to WASP_SERVER_URL, and your app's pages and its API are on the same origin now, so setting WASP_SERVER_URL to your domain is all it takes.
Step 4: Create GitHub Action
Create .github/workflows/deploy.yml in your repository:
name: "Deploy"
on:
push:
branches:
- "main"
concurrency:
group: deployment
cancel-in-progress: true
env:
WASP_VERSION: "0.25"
APP_NAME: "myapp"
DOCKER_REGISTRY: "ghcr.io"
DOCKER_REGISTRY_USERNAME: ${{ github.repository_owner }}
DOCKER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
jobs:
build-and-push-image:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
# Remove this block if your app is NOT in an 'app' folder
defaults:
run:
working-directory: ./app
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.DOCKER_REGISTRY_USERNAME }}
password: ${{ env.DOCKER_REGISTRY_PASSWORD }}
- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_REGISTRY_USERNAME }}/${{ env.APP_NAME }}
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24.14.1"
- name: Install Wasp
shell: bash
run: npm i -g @wasp.sh/wasp-cli@${{ env.WASP_VERSION }}
- name: Install Wasp app dependencies
run: wasp install
- name: Build Wasp app
run: wasp build
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
# Remove 'app/' if your app is at the repo root
context: ./app/.wasp/out
file: ./app/.wasp/out/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Trigger Deploy Webhook
env:
COOLIFY_WEBHOOK: ${{ secrets.COOLIFY_WEBHOOK }}
COOLIFY_TOKEN: ${{ secrets.COOLIFY_TOKEN }}
run: |
curl "${{ env.COOLIFY_WEBHOOK }}" --header 'Authorization: Bearer ${{ env.COOLIFY_TOKEN }}'
Environment variables prefixed with REACT_APP_ end up inside your app's pages and assets, so they have to be there when the image is built, not when it runs. If your app has any, pass them to the image build with the WASP_CLIENT_ENV build argument, as shell assignments:
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
# ...
build-args: |
WASP_CLIENT_ENV=REACT_APP_EXAMPLE='value'; REACT_APP_OTHER='another value'
Anyone can read them in the browser, so never put secrets there. Server environment variables stay where they were, in Coolify (step 3).
Step 5: Configure GitHub Secrets
In your GitHub repository, go to Settings > Secrets and variables > Actions and add:
COOLIFY_WEBHOOK
- Go to your app in Coolify
- Click Webhooks
- Copy the Deploy Webhook URL
COOLIFY_TOKEN
- In Coolify, go to Settings and under Advanced enable API Access
- Go to Keys & Tokens > API tokens
- Create a new API token with Deploy permissions
- Copy the token
Step 6: Deploy
Push to the main branch and the GitHub Action will:
- Build your Wasp application
- Create a Docker image for it
- Push the image to GitHub Container Registry
- Trigger Coolify to deploy the new image
Your app should now be accessible at https://myapp.com!