From 56c575cbf1880fbec9b1c9f0bd6cdfedda94e8b6 Mon Sep 17 00:00:00 2001 From: Jvst Me Date: Thu, 10 Jul 2025 12:18:47 +0200 Subject: [PATCH] [Docs]: Add example of setting a PostgreSQL URL --- docs/docs/guides/server-deployment.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/guides/server-deployment.md b/docs/docs/guides/server-deployment.md index 8ff4034e62..ee47f481a4 100644 --- a/docs/docs/guides/server-deployment.md +++ b/docs/docs/guides/server-deployment.md @@ -124,7 +124,11 @@ Postgres has no such limitation and is recommended for production deployment. ### PostgreSQL -To store the server state in Postgres, set the `DSTACK_DATABASE_URL` environment variable. +To store the server state in Postgres, set the `DSTACK_DATABASE_URL` environment variable: + +```shell +$ DSTACK_DATABASE_URL=postgresql+asyncpg://user:password@db-host:5432/dstack dstack server +``` ??? info "Migrate from SQLite to PostgreSQL" You can migrate the existing state from SQLite to PostgreSQL using `pgloader`: