

How to deploy Langtrace with Northflank
If you need a reliable and open-source solution to monitor, trace, and analyze your LLM applications, Langtrace is one of the best options available. It helps you observe every part of your AI workflows, from model calls to chain execution, making it easier to debug, optimize, and scale production systems.
With Northflank, you can deploy Langtrace in minutes using a one-click template or set it up manually. Northflank takes care of scaling, networking, and infrastructure so you can focus on monitoring and improving your AI applications.
Before you begin, create a Northflank account.
- Deploying Langtrace with a one-click template on Northflank
- Deploying Langtrace manually on Northflank
What is Northflank?
Northflank is a developer platform that makes it easy to build, deploy, and scale applications, databases, jobs, and GPU workloads. It abstracts away Kubernetes complexity with smart defaults, giving you production-ready deployments while still allowing advanced customization.
You can launch Langtrace on Northflank in a few minutes using the official stack template. This is the fastest way to get Langtrace up and running without manual configuration.
The Langtrace deployment on Northflank includes:
- 1 PostgreSQL addon for storing metadata and operational data
- 1 ClickHouse service for analytics and trace storage
- 2 secret groups for credentials and environment variables
- 1 persistent volume for ClickHouse storage
- 1 Langtrace service deployed from the official Docker image
scale3labs/langtrace-client:latest
- Visit the Langtrace template on Northflank.
- Click Deploy.
- Northflank will automatically:
- Create a project, database, ClickHouse service, secret groups, and the Langtrace deployment
- Link the database credentials to your secret groups
- Expose a public URL for your Langtrace instance
- Once the deployment is complete, open the public URL to access the Langtrace UI.
If you want more flexibility or need to customize your setup, you can deploy Langtrace manually. This approach provides you with complete control over configuration and integration.
Note: You can also customise Northflank's one-click deploy templates.
Log in to your Northflank dashboard and click the Create new button in the top right corner. Select Project from the dropdown.
Projects act as workspaces that group related services, making it easier to manage multiple resources.
You’ll need to fill out a few details before moving forward.
-
Enter a project name, such as
langtrace-project
and optionally pick a color for quick identification in your dashboard. -
Select Northflank Cloud as the deployment target. This uses Northflank’s fully managed infrastructure, so you do not need to worry about Kubernetes setup or scaling.
(Optional) If you prefer to run on your own infrastructure, you can select Bring Your Own Cloud and connect AWS, GCP, Azure, or on-prem resources.
-
Choose a region closest to your users to minimize latency.
-
Click Create project to finalize the setup.
Inside your project, go to the Addons tab and click “Create new addon.” Then, select PostgreSQL as the Addon type, give it a descriptive name such as langtrace-db
. Select your preferred version, and choose a compute plan size.
- If you’re testing or experimenting, the smallest option is cost-effective and sufficient.
- For production, we recommend starting with
nf-compute-50
. This provides more resources and stability, ensuring Langflow runs reliably under real workloads.
Once you’ve configured the settings, click Create addon to provision your database.
Next, navigate to the Secrets tab and click "Create Secret Group." Name it something easy to recognize, such aslangtrace-clickhouse-secrets
. This group will hold all the environment variables required by ClickHouse. You can find the full list of supported variables in the Clickhouse docs.
If you don't want to go through the stress of manually configuring or searching for environment variables to use, you can use the already configured ones below:
CLICKHOUSE_DB="langtrace_metrics"
CLICKHOUSE_USER="clickhouse"
CLICKHOUSE_PASSWORD=XXXXXXXXXXXXXXXX
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT="1"
Notes about these values:
CLICKHOUSE_DB
specifies the name of the database Langtrace will use for metrics and trace data.CLICKHOUSE_USER
defines the username used to connect to ClickHouse.CLICKHOUSE_PASSWORD
should be replaced with a strong, unique password for production environments.CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT
enables user access control within ClickHouse, improving security and access management.
Within your project, navigate to the Services tab in the top menu and click ’Create New Service’. Select Deployment and give your service a name such as lantrace-clickhouse-server
.
For the deployment source, choose External image and enter the official ClickHouse Docker image: clickhouse/clickhouse-server:latest
.
Select compute resources
Choose the compute size that best matches your workload:
- Small plans are fine for testing or lightweight usage.
- Larger plans are recommended for production, as Langflow can be resource-intensive under real-world traffic.
The flexibility to adjust resources later means you can start small and scale up as needed.
Set up a port so your app is accessible:
- Port:
8123
- Protocol:
HTTP
- Public access: enable this to let people access your app from the internet
Northflank will automatically generate a secure, unique public URL for your service. This saves you from having to manage DNS or SSL certificates manually.
Click Create service to deploy ClickHouse. Once successful, you’ll see the public URL in the top right corner. e.g.: p01--clickhouse--lppg6t2b6kzf.code.run
Inside your project, go to the Volumes tab and click Create new volume.
- Name it
langtrace-clickhouse-volume
- Choose a storage type (NVMe is recommended)
- Choose a storage size (start small for testing, scale up for production)
- Set the volume mount path to
/var/lib/clickhouse
- Attach the volume to your
Langtrace-clickhouse-server
service to enable persistent storage.
Click Create volume to finalize.
After successfully creating your volume, you need to restart your service. Once completed, you can access your deployed ClickHouse service.
Go back to the Secrets tab and click Create Secret Group. Name it langtrace-secrets
. This group will hold the environment variables required by Langtrace. Refer to the Langtrace documentation for the full list.
If you prefer, you can use the example variables below:
ADMIN_EMAIL=XXXXXXXXXXXXXXXXX
ADMIN_PASSWORD=XXXXXXXXXXXXXXXXX
NEXT_PUBLIC_ENABLE_ADMIN_LOGIN=true
NEXT_PUBLIC_APP_NAME="Langtrace"
NEXT_PUBLIC_HOST="https://${refs.langtrace-app.ports.0.dns}"
NEXT_PUBLIC_ENVIRONMENT="production"
NEXTAUTH_URL="https://${refs.langtrace-app.ports.0.dns}"
NEXTAUTH_URL_INTERNAL="https://${refs.langtrace-app.ports.0.dns}"
NEXTAUTH_SECRET="difficultsecret"
CLICK_HOUSE_PASSWORD="${CLICKHOUSE_PASSWORD}"
CLICK_HOUSE_DATABASE_NAME="${CLICKHOUSE_DB}"
CLICK_HOUSE_USER="${CLICKHOUSE_USER}"
CLICK_HOUSE_HOST="https://${refs.langtrace-clickhouse-server.ports.0.dns}"
POSTGRES_HOST="${DB_HOST}:${DB_PORT}"
POSTGRES_PRISMA_URL="${POSTGRES_URL}?pgbouncer=true&connect_timeout=15"
Notes about these values:
ADMIN_EMAIL
andADMIN_PASSWORD
are used to create the default admin account for logging into your Langtracedashboard.NEXT_PUBLIC_ENABLE_ADMIN_LOGIN
enables admin authentication. Keep this set totrue
to access the admin panel.NEXT_PUBLIC_APP_NAME
sets the display name of your Langtrace instance, which appears in the UI.NEXT_PUBLIC_HOST
defines the public URL of your application. This uses${refs.langtrace-app.ports.0.dns}
so Northflankcan automatically inject the correct domain name for your service.NEXT_PUBLIC_ENVIRONMENT
sets the environment type, such asproduction
orstaging
.NEXTAUTH_URL
andNEXTAUTH_URL_INTERNAL
are required for authentication and session management. These point to the same public domain and should match your host.NEXTAUTH_SECRET
is a randomly generated string used to securely sign and encrypt session tokens. You should replace the example with a strong secret.CLICK_HOUSE_PASSWORD
,CLICK_HOUSE_DATABASE_NAME
,CLICK_HOUSE_USER
, andCLICK_HOUSE_HOST
configure your ClickHouse database connection. These values are automatically injected from your ClickHouse secret group and service reference.POSTGRES_HOST
specifies the connection string (host and port) for your PostgreSQL database.POSTGRES_PRISMA_URL
configures the database URL used by Prisma. It includes pgbouncer and timeout settings for improved performance and stability.- References like
${refs.langtrace-app.ports.0.dns}
and${refs.langtrace-clickhouse-server.ports.0.dns}
are dynamic placeholders. When you deploy, Northflank automatically replaces them with the correct DNS values for each service, so you don’t need to hardcode domain names or ports.
Link the PostgreSQL addon to your secret group
Northflank addons expose connection details like username and password. Instead of copying values manually, you can link the addon directly to your secret group. This way, if credentials rotate, your service receives the updated values automatically.
- Map
USERNAME
toPOSTGRES_USER
- Map
PASSWORD
toPOSTGRES_PASSWORD
- Map
DATABASE
toPOSTGRES_DATABASE
andDATABASE
- Map
POSTGRES_URI
toPOSTGRES_URL_NO_SSL
,POSTGRES_URL
, andPOSTGRES_URL_NON_POOLING
- Map
HOST
toDB_HOST
- Map
PORT
toDB_PORT
Click Create secret group to save everything.
Open the Services tab and click Create New Service. Select Deployment and name your service langtrace-app
.
For the deployment source, choose External image and enter the official Langtrace image: scale3labs/langtrace-client:latest
.
Select compute resources
Choose the compute size that best matches your workload:
- Small plans are fine for testing or lightweight usage.
- Larger plans are recommended for production, as Langtrace can be resource-intensive under real-world traffic.
Set up a port so your app is accessible:
- Port:
3000
- Protocol:
HTTP
- Public access: enable this to let people access your app from the internet
Northflank will generate a secure, unique public URL for your service.
Deploy your service
Click Create service. Once deployed, the public URL will be visible at the top right corner, e.g.: p01--langtrace--lppg6t2b6kzf.code.run
Deploying Langtrace on Northflank gives you a production-ready observability platform without managing Kubernetes, networking, or scaling infrastructure.
Whether you use the one-click template for speed or manual setup for full control, Northflank provides the platform while Langtrace powers your tracing and analytics. This combination is ideal for monitoring, debugging, and optimizing LLM-based applications at scale.