Coolify Template

Hello rivet team, are there any plans for having a Rivet template available on Coolify? It would be fully awesome to also have a one-click deploy of Rivet but on your own server instead of a managed service Lot's of Services like Appwrite, Supabase, even analytics tool have templates available on Coolify See the list here: https://coolify.io/docs/services/overview
Coolify Docs
Self hosting with superpowers: An open-source & self-hostable Heroku / Netlify / Vercel alternative.
No description
37 Replies
Nicholas
Nicholasβ€’2mo ago
yeah we can do that
kolabrine
kolabrineOPβ€’2mo ago
Awesome πŸš€ As soon this is available on Coolify as a service, I will test it πŸ’―
Nicholas
Nicholasβ€’2mo ago
cc @ABC
Nathan
Nathanβ€’2mo ago
let's get this going, been wanted to get coolify going for a bit now
Yipfram
Yipframβ€’2mo ago
Hi, i'm actually working on one πŸ™‚ The problem is that I'm having issues with the postgres DB... Here is the docker compose:
# documentation: https://www.rivet.dev/docs
# slogan: Open-source visual AI programming environment for building AI agents with LLMs
# category: ai
# tags: ai, visual programming, llm, chatbot, agent, postgresql
# logo: svgs/rivet.svg
# port: 6420

services:
rivet-engine:
image: rivetkit/engine:25.8.0
environment:
- SERVICE_URL_RIVET_6420
- RIVET__POSTGRES__URL=postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@postgresql:5432/${POSTGRESQL_DATABASE-rivet}
- RIVET__FILE_SYSTEM__PATH=/data
volumes:
- rivet-data:/data
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://127.0.0.1:6420/health || exit 1"]
interval: 5s
timeout: 20s
retries: 10

postgresql:
image: postgres:15-alpine
volumes:
- rivet-postgresql-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${SERVICE_USER_POSTGRESQL}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL}
- POSTGRES_DB=${POSTGRESQL_DATABASE-rivet}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 20s
retries: 10
# documentation: https://www.rivet.dev/docs
# slogan: Open-source visual AI programming environment for building AI agents with LLMs
# category: ai
# tags: ai, visual programming, llm, chatbot, agent, postgresql
# logo: svgs/rivet.svg
# port: 6420

services:
rivet-engine:
image: rivetkit/engine:25.8.0
environment:
- SERVICE_URL_RIVET_6420
- RIVET__POSTGRES__URL=postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@postgresql:5432/${POSTGRESQL_DATABASE-rivet}
- RIVET__FILE_SYSTEM__PATH=/data
volumes:
- rivet-data:/data
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://127.0.0.1:6420/health || exit 1"]
interval: 5s
timeout: 20s
retries: 10

postgresql:
image: postgres:15-alpine
volumes:
- rivet-postgresql-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${SERVICE_USER_POSTGRESQL}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL}
- POSTGRES_DB=${POSTGRESQL_DATABASE-rivet}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 20s
retries: 10
Nathan
Nathanβ€’2mo ago
resolved in other thread
Yipfram
Yipframβ€’2mo ago
which one?
Yipfram
Yipframβ€’2mo ago
Hey @ifirix here is the PR: https://github.com/coollabsio/coolify/pull/6963 You can copy the Yaml and click on Docker Compose Empty and paste the PR's .yaml template in the meantime. The coolify repo is going fast these recent days, a huge beta version will be released, the PR might be merged this week...
GitHub
Add Rivet template by yipfram Β· Pull Request #6963 Β· coollabsio/c...
Description This PR adds a Docker Compose template for Rivet - an open-source visual AI programming environment for building AI agents with LLMs. What's included rivet-engine: Main Rivet ...
No description
Yipfram
Yipframβ€’2mo ago
Merged today
kolabrine
kolabrineOPβ€’2mo ago
Sorry for the late response, i managed to deploy the container on coolify but i'm getting certain issues when i am trying to connect from the backend locally. Compose File Example:
services:
rivet-engine:
image: 'rivetkit/engine:latest'
environment:
- SERVICE_URL_RIVET_6420
- 'RIVET__AUTH__ADMIN_TOKEN=${SERVICE_PASSWORD_RIVET}'
- 'RIVET__POSTGRES__URL=postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@postgresql:5432/${POSTGRESQL_DATABASE-rivet}'
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- '-f'
- 'http://127.0.0.1:6420/health'
interval: 2s
timeout: 10s
retries: 10
start_period: 30s
postgresql:
image: 'postgres:17-alpine'
volumes:
- 'rivet-postgresql-data:/var/lib/postgresql/data'
environment:
- 'POSTGRES_USER=${SERVICE_USER_POSTGRESQL}'
- 'POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL}'
- 'POSTGRES_DB=${POSTGRESQL_DATABASE-rivet}'
healthcheck:
test:
- CMD-SHELL
- 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'
interval: 5s
timeout: 20s
retries: 10
services:
rivet-engine:
image: 'rivetkit/engine:latest'
environment:
- SERVICE_URL_RIVET_6420
- 'RIVET__AUTH__ADMIN_TOKEN=${SERVICE_PASSWORD_RIVET}'
- 'RIVET__POSTGRES__URL=postgresql://$SERVICE_USER_POSTGRESQL:$SERVICE_PASSWORD_POSTGRESQL@postgresql:5432/${POSTGRESQL_DATABASE-rivet}'
depends_on:
postgresql:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- '-f'
- 'http://127.0.0.1:6420/health'
interval: 2s
timeout: 10s
retries: 10
start_period: 30s
postgresql:
image: 'postgres:17-alpine'
volumes:
- 'rivet-postgresql-data:/var/lib/postgresql/data'
environment:
- 'POSTGRES_USER=${SERVICE_USER_POSTGRESQL}'
- 'POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL}'
- 'POSTGRES_DB=${POSTGRESQL_DATABASE-rivet}'
healthcheck:
test:
- CMD-SHELL
- 'pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}'
interval: 5s
timeout: 20s
retries: 10
I took the Rivet example on railway you guys made:
import { actor, setup } from "rivetkit";

export type Message = { sender: string; text: string; timestamp: number };

export const chatRoom = actor({
// Persistent state that survives restarts: https://rivet.dev/docs/actors/state
state: {
messages: [] as Message[],
},

actions: {
// Callable functions from clients: https://rivet.dev/docs/actors/actions
sendMessage: (c, sender: string, text: string) => {
const message = { sender, text, timestamp: Date.now() };
// State changes are automatically persisted
c.state.messages.push(message);
// Send events to all connected clients: https://rivet.dev/docs/actors/events
c.broadcast("newMessage", message);
return message;
},

getHistory: (c) => c.state.messages,
},
});

// Register actors for use: https://rivet.dev/docs/setup
export const registry = setup({
use: { chatRoom },
});
import { actor, setup } from "rivetkit";

export type Message = { sender: string; text: string; timestamp: number };

export const chatRoom = actor({
// Persistent state that survives restarts: https://rivet.dev/docs/actors/state
state: {
messages: [] as Message[],
},

actions: {
// Callable functions from clients: https://rivet.dev/docs/actors/actions
sendMessage: (c, sender: string, text: string) => {
const message = { sender, text, timestamp: Date.now() };
// State changes are automatically persisted
c.state.messages.push(message);
// Send events to all connected clients: https://rivet.dev/docs/actors/events
c.broadcast("newMessage", message);
return message;
},

getHistory: (c) => c.state.messages,
},
});

// Register actors for use: https://rivet.dev/docs/setup
export const registry = setup({
use: { chatRoom },
});
My .env example
# Internal-------------

# Token to connect to the Rivet Engine with.
RIVET_TOKEN=${MY_RIVET_ENGINE_TOKEN}

# Internal endpoint of Rivet for the backend to connect to.
RIVET_ENGINE=${MY_RIVET_ENGINE_URL}

# The namespace to run actors in.
RIVET_NAMESPACE=production
RIVET_RUNNER=worker-01
RIVET_RUNNER_KEY=9288deaa3f56eef5d5f49195210fff84
# Internal-------------

# Token to connect to the Rivet Engine with.
RIVET_TOKEN=${MY_RIVET_ENGINE_TOKEN}

# Internal endpoint of Rivet for the backend to connect to.
RIVET_ENGINE=${MY_RIVET_ENGINE_URL}

# The namespace to run actors in.
RIVET_NAMESPACE=production
RIVET_RUNNER=worker-01
RIVET_RUNNER_KEY=9288deaa3f56eef5d5f49195210fff84
kolabrine
kolabrineOPβ€’2mo ago
On the package.json I updated rivetkit to 2.0.21 Everytime i start the backend, i get this issue:
No description
kolabrine
kolabrineOPβ€’2mo ago
@Nathan Looks like it is an issue on the SDK running on backend @Yipfram the container looks to be running pretty good!
Yipfram
Yipframβ€’2mo ago
Any container log? Are you using ip as url or fqdn?
kolabrine
kolabrineOPβ€’2mo ago
fqdn, specifically the SERVICE_URL_RIVET Will look into it!
2025-10-26T06:41:18.740051461Z ts=2025-10-26T06:41:18.739764978Z level=warn message="invalid host for current datacenter" host="\"${SERVICE_URL_RIVET}\"" datacenter="\"default\"" hostname=${SERVICE_URL_RIVET} path="/?protocol_version=1&namespace=production&runner_key=9288deaa3f56eef5d5f49195210fff84" port_type=Http headers="{\"host\": \"${SERVICE_URL_RIVET}\", \"user-agent\": \"node\", \"accept\": \"*/*\", \"accept-encoding\": \"gzip, br\", \"accept-language\": \"*\", \"cache-control\": \"no-cache\", \"cdn-loop\": \"cloudflare; loops=1\", \"cf-connecting-ip\": \"104.83.56.214\", \"cf-ipcountry\": \"US\", \"cf-ray\": \"9947f79b7b02b033-ATL\", \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\", \"connection\": \"Upgrade\", \"pragma\": \"no-cache\", \"sec-fetch-mode\": \"websocket\", \"sec-websocket-extensions\": \"permessage-deflate; client_max_window_bits\", \"sec-websocket-key\": \"MpwZ9FQ7XL135+JTXYEFKQ==\", \"sec-websocket-protocol\": \"rivet, rivet_target.runner, rivet_token.1Wj0dIi2EezoLG7VOPmtKdiE34AhIxep\", \"sec-websocket-version\": \"13\", \"upgrade\": \"websocket\", \"x-forwarded-for\": \"203.12.45.77\", \"x-forwarded-host\": \"${SERVICE_URL_RIVET}\", \"x-forwarded-port\": \"443\", \"x-forwarded-proto\": \"wss\", \"x-forwarded-server\": \"51e981107eee\", \"x-real-ip\": \"203.12.45.77\"}" ignore_cache=false hostname=${SERVICE_URL_RIVET} path="/?protocol_version=1&namespace=production&runner_key=9288deaa3f56eef5d5f49195210fff84" port_type=Http
2025-10-26T06:41:18.740171744Z ts=2025-10-26T06:41:18.739832519Z level=error message="Request failed" err="must_use_regional_host: Invalid host ${SERVICE_URL_RIVET} for datacenter default. Please use one of the following hosts: 127.0.0.1"
2025-10-26T06:41:18.740051461Z ts=2025-10-26T06:41:18.739764978Z level=warn message="invalid host for current datacenter" host="\"${SERVICE_URL_RIVET}\"" datacenter="\"default\"" hostname=${SERVICE_URL_RIVET} path="/?protocol_version=1&namespace=production&runner_key=9288deaa3f56eef5d5f49195210fff84" port_type=Http headers="{\"host\": \"${SERVICE_URL_RIVET}\", \"user-agent\": \"node\", \"accept\": \"*/*\", \"accept-encoding\": \"gzip, br\", \"accept-language\": \"*\", \"cache-control\": \"no-cache\", \"cdn-loop\": \"cloudflare; loops=1\", \"cf-connecting-ip\": \"104.83.56.214\", \"cf-ipcountry\": \"US\", \"cf-ray\": \"9947f79b7b02b033-ATL\", \"cf-visitor\": \"{\\\"scheme\\\":\\\"https\\\"}\", \"connection\": \"Upgrade\", \"pragma\": \"no-cache\", \"sec-fetch-mode\": \"websocket\", \"sec-websocket-extensions\": \"permessage-deflate; client_max_window_bits\", \"sec-websocket-key\": \"MpwZ9FQ7XL135+JTXYEFKQ==\", \"sec-websocket-protocol\": \"rivet, rivet_target.runner, rivet_token.1Wj0dIi2EezoLG7VOPmtKdiE34AhIxep\", \"sec-websocket-version\": \"13\", \"upgrade\": \"websocket\", \"x-forwarded-for\": \"203.12.45.77\", \"x-forwarded-host\": \"${SERVICE_URL_RIVET}\", \"x-forwarded-port\": \"443\", \"x-forwarded-proto\": \"wss\", \"x-forwarded-server\": \"51e981107eee\", \"x-real-ip\": \"203.12.45.77\"}" ignore_cache=false hostname=${SERVICE_URL_RIVET} path="/?protocol_version=1&namespace=production&runner_key=9288deaa3f56eef5d5f49195210fff84" port_type=Http
2025-10-26T06:41:18.740171744Z ts=2025-10-26T06:41:18.739832519Z level=error message="Request failed" err="must_use_regional_host: Invalid host ${SERVICE_URL_RIVET} for datacenter default. Please use one of the following hosts: 127.0.0.1"
My coolify instance is protected by a cloudflare proxy Maybe that is the cause πŸ€” The Cloudflare Proxy I disabled the proxy, still getting the same error log My environment: I have the coolify instance hosted on the cloud (Hetzner Server) Protected by a Cloudflare Proxy I am trying to run the backend (the railway template) locally on my machine
Yipfram
Yipframβ€’2mo ago
did you edit this log? Is it written SERVICE_URL_RIVET in there?
Nathan
Nathanβ€’2mo ago
will catch up on this, but fyi we shipped an arm image last night
kolabrine
kolabrineOPβ€’2mo ago
Yes, i edited the log. I hid it by replacing the domain with SERVICE_URL_RIVET @Nathan Thanks for the update! But this time i am using a Intel x64 dedicated server πŸ’―
Nathan
Nathanβ€’2mo ago
finally catching up on this @kolabrine looks like you found the error. we added behavior recently that filters incoming hosts to validate you're connecting to the correct region: https://github.com/rivet-dev/rivet/blob/8d20c5f4230599757abbe06cbe67e04e32f7ab85/engine/packages/config/src/config/topology.rs#L91 i'm going to disable this behavior by default in dev since it's not useful unless you're running a multi-region deployment. let me ship a release for that right now.
GitHub
rivet/engine/packages/config/src/config/topology.rs at 8d20c5f42305...
An open-source library for long-lived processes with realtime, persistence, and hibernation - rivet-dev/rivet
kolabrine
kolabrineOPβ€’2mo ago
Awesome, will wait for the Docker Image release πŸš€
Nathan
Nathanβ€’2mo ago
try rivetkit/engine-2.0.21-rc.1
kolabrine
kolabrineOPβ€’2mo ago
@Nathan The issue is persisting but now i got these logs instead on the message.txt
kolabrine
kolabrineOPβ€’2mo ago
From Coolify image seems to be running fine
No description
kolabrine
kolabrineOPβ€’2mo ago
Just in case, The Proxy From Cloudflare is completely disabled. I still have it disabled Update: Now i will test it with the proxy enabled Yep, same error logs
kolabrine
kolabrineOPβ€’2mo ago
No description
Nathan
Nathanβ€’2mo ago
what are your env vars for the engine? i'll manually test this in a second to see what's up
kolabrine
kolabrineOPβ€’2mo ago
@Nathan Will DM you the .env variables So you can have direct access
Nathan
Nathanβ€’2mo ago
@kolabrine any chance you're using bun and getting this same error? https://discord.com/channels/822914074136018994/1432630181033410560/1432927833470013470
kolabrine
kolabrineOPβ€’2mo ago
Using Node v22.19.0 Not used bun at all
Nathan
Nathanβ€’2mo ago
can you run the node process LOG_LEVEL=debug? it should log a descriptive error code of why your runner is disconnected next release includes the error code in warning so it's easier to diagnose thx for the help here
kolabrine
kolabrineOPβ€’2mo ago
Sorry for the late response @Nathan dm you the logs πŸ’― Guys i think i found the cause of the issue. My node app was trying to connect to a namespace that was not created on the first place ☠️
RIVET_NAMESPACE=production
RIVET_NAMESPACE=production
kolabrine
kolabrineOPβ€’2mo ago
No description
kolabrine
kolabrineOPβ€’2mo ago
I discovered it using the LOG_LEVEL=debug @Nathan recommended πŸ’― As a suggestion for improving the DX, on the error logs there could be a feedback like Runner disconnected: Namespace does not exists
kolabrine
kolabrineOPβ€’2mo ago
Finally connected to the remote rivet instance βœ…
No description
kolabrine
kolabrineOPβ€’2mo ago
@Yipfram The template/service you created is running fine βœ… Maybe you can share important tips when updating the docker compose file on coolify So the devs can update the templates when they launch new rivetkit versions. https://github.com/coollabsio/coolify/blob/next/templates/compose/rivet-engine.yaml
No description
Yipfram
Yipframβ€’2mo ago
I don't understand πŸ˜… Do you mean sharing tips for rivet community or coolify docs? What tips? Do you mean updating the templates docker image version for rivet/engine?
kolabrine
kolabrineOPβ€’2mo ago
My bad i meant, yes for rivet community. and yes for Updating the templates docker image version for rivet/engine I was wondering if opening a PR that only updates the image version is enough, or if there’s another important step I might be missing. UPDATE: they already have docs for it: https://coolify.io/docs/get-started/contribute/service
Coolify Docs
Self hosting with superpowers: An open-source & self-hostable Heroku / Netlify / Vercel alternative.

Did you find this page helpful?