---
title: "Deploy Nao"
description: "Self Host Analytics Agent,Create Context,Nao chat included"
category: "Other"
url: https://railway.com/deploy/nao
---

# Deploy Nao

Self Host Analytics Agent,Create Context,Nao chat included

**[Deploy Nao on Railway](https://railway.com/template/nao)**

- **Creator:** Muhammad Bilal
- **Category:** Other

## Template content

### Nao

- **Image:** getnao/nao:latest
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

## Documentation

# Deploy and Host Nao on Railway

Nao is a self-hosted framework for building and deploying analytics agents. Data teams can create an agent context containing data, metadata, documentation, modeling, rules, tools, and MCPs, then deploy a chat interface where users ask natural-language questions and receive analytics, SQL-driven insights, and visualizations.

## About Hosting Nao

Hosting Nao on Railway involves deploying the Nao application from its Docker image and connecting it to a PostgreSQL database for application data. Nao can use external data warehouses and other data sources configured through its agent context, along with an LLM provider such as OpenAI or Anthropic. Your Nao context can be maintained in a Git repository or included with the deployed project. Railway provides the application networking, public HTTPS domain, database infrastructure, environment variables, and scaling needed to run Nao in production without managing servers manually.

## Common Use Cases

* Deploy a self-hosted analytics agent that lets business users ask questions about company data in natural language.
* Give data teams a centralized interface for building, testing, versioning, and monitoring analytics-agent context.
* Provide secure, self-hosted analytics experiences using your own data warehouse and LLM provider credentials.

## Dependencies for Nao Hosting

* **Nao application** — deployed using the `getnao/nao:latest` Docker image.
* **PostgreSQL** — used by Nao as its application database.
* **LLM provider** — such as OpenAI or Anthropic, configured according to your Nao project.
* **Analytics data source** — a data warehouse or database containing the data your agent will analyze.
* **Nao context** — a configured `nao_config.yaml` and associated context files. The context can optionally be maintained in Git.

### Deployment Dependencies

* Nao documentation: [docs.getnao.io](https://docs.getnao.io/?utm_source=chatgpt.com)
* Nao self-hosting deployment guide: [Self-hosting deployment guide](https://docs.getnao.io/nao-agent/self-hosting/deployment-guide?utm_source=chatgpt.com)
* Nao GitHub repository: [GitHub repository](https://github.com/getnao/nao?utm_source=chatgpt.com)
* Nao Docker image: [Docker Hub](https://hub.docker.com/r/getnao/nao?utm_source=chatgpt.com)
* Railway PostgreSQL: [Railway PostgreSQL](https://docs.railway.com/databases/postgresql?utm_source=chatgpt.com)

### Implementation Details

Deploy the Nao application using:

```text
getnao/nao:latest
```

Create a PostgreSQL service in the same Railway project and connect Nao to it using a Railway reference variable:

```env
DB_URI=${{Postgres.DATABASE_URL}}
```

Replace `Postgres` with the exact name of your Railway PostgreSQL service.

Nao's documented Docker deployment uses port `5005`, so configure the application accordingly:

```env
PORT=5005
```

After generating a Railway public domain, configure the authentication URL:

```env
BETTER_AUTH_URL=https://${{RAILWAY_PUBLIC_DOMAIN}}
```

LLM credentials and credentials for external analytics data sources should be stored as Railway secrets rather than committed to the Nao project.

If the Nao project is bundled into the deployed image, it can be placed at:

```text
/app/project
```

and configured with:

```env
NAO_DEFAULT_PROJECT_PATH=/app/project
```

Alternatively, the Nao context can be maintained in a Git repository and configured through the appropriate Nao context settings.

## Why Deploy Nao on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Nao on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/nao
