Coolify
Learn how to deploy to a VPS with self-hosted Coolify.
This is for the self-hosted version. We create and deploy two apps. Both will be able to link between each other.
Preparation
Prerequisites
- VPS (Debian or Ubuntu recommended)
- SSH access to your VPS
Update the system
sudo apt update && sudo apt upgrade -yInstall Coolify
curl -fsSL https://cdn.coollabs.io/coolify/install.sh | sudo bashStart Coolify
sudo coolify startConnect GitHub Repository
- Choose the Production environment.
- Click Add a new resource.
- Select Private Repository (with GitHub App).
Marketing App
1. Create a New Application
Once your GitHub repository is connected:
- Select the GitHub App connection you just created.
- Choose the repository you want to deploy.
- Select the branch to deploy (e.g.,
main).
2. Configure the Application
You’ll be redirected to the application configuration page. Set the following build options:
-
Install Command:
pnpm install -
Build Command:
corepack enable; pnpm install --frozen-lockfile; pnpm build -
Start Directory:
pnpm --filter web start
3. Add Environment Variables
Before deploying:
- Go to the Environment Variables tab.
- Add all environment variables from your
.envfile. - Ensure you’re using the production values.
4. Deploy the Application
- Click Deploy to start the build and deployment process.
- Once the build completes, your application will be live on your server.
5. Set a Custom Domain
- On the configuration page, enter your custom domain in the Domain field.
- Add this domain as the value for the
NEXT_PUBLIC_MARKETING_URLenvironment variable under Environment Variables. - Click Redeploy in the top right corner to apply the changes.
Dashboard App
1. Create a New Application
Once your GitHub repository is connected:
- Select the GitHub App connection.
- Choose the repository you want to deploy.
- Select the branch to deploy (e.g.,
main).
2. Configure the Application
You’ll be redirected to the application configuration page. Set the following build options:
-
Install Command:
pnpm install -
Build Command:
corepack enable; pnpm install --frozen-lockfile; pnpm build -
Start Directory:
pnpm --filter dashboard start
3. Add Environment Variables
Before deploying:
- Go to the Environment Variables tab.
- Add all environment variables from your
apps/dashboard/.envfile. - Ensure you’re using the production values.
4. Deploy the Application
- Click Deploy to start the build and deployment process.
- Once the build completes, your application will be live on your server.
5. Set a Custom Domain
- On the configuration page, enter your custom domain in the Domain field.
- Add this domain as the value for the
NEXT_PUBLIC_MARKETING_URLenvironment variable under Environment Variables. - Click Redeploy in the top right corner to apply the changes.