---
title: "Deploy Narrowdb"
description: "A lightweight columnar database engine for log and time-series data"
category: "Storage"
url: https://railway.com/deploy/narrowdb
---

# Deploy Narrowdb

A lightweight columnar database engine for log and time-series data

**[Deploy Narrowdb on Railway](https://railway.com/template/narrowdb)**

- **Creator:** Team Lasse
- **Category:** Storage
- **Total deploys:** 8

## Template content

### Narrowdb

- **Image:** ghcr.io/lassejlv/narrowdb:latest

## Documentation

# Deploy and Host NarrowDB on Railway

NarrowDB is a lightweight columnar database engine for log and time-series data, written in Rust. It offers 5x faster ingestion than DuckDB, 34% smaller storage, and sub-5ms analytical queries at 10M rows. It speaks the PostgreSQL wire protocol, so any Postgres client can connect directly.

## About Hosting NarrowDB

NarrowDB ships as a single binary with a built-in TCP server that implements the PostgreSQL wire protocol. Deploying it on Railway requires no external dependencies — just build the Rust binary and expose the server port. Data is persisted to a single file on disk using memory-mapped I/O. Configure the listen address, port, username, and password through environment variables. Any standard PostgreSQL client, ORM, or dashboard tool can connect to it out of the box.

## Common Use Cases

- Centralized log storage and analytics for microservices, with fast filtered aggregation queries
- Time-series metrics collection with high-throughput columnar ingestion
- Lightweight embedded analytics backend for applications that need SQL queries without the overhead of a full database server

## Dependencies for NarrowDB Hosting

- Rust toolchain (build only — the resulting binary has zero runtime dependencies)
- Persistent volume for data storage

### Deployment Dependencies

- [NarrowDB on GitHub](https://github.com/lassejlv/narrowdb)
- [NarrowDB on crates.io](https://crates.io/crates/narrowdb)

### Implementation Details

The server is started with environment variables:

```bash
NARROWDB_LISTEN=0.0.0.0:5433
NARROWDB_USER=narrowdb
NARROWDB_PASSWORD=secret
narrowdb-server ./data/logs.narrowdb
```

Connect with any Postgres client:

```bash
PGPASSWORD=secret psql "host=your-app.railway.app port=5433 user=narrowdb dbname=logs"
```

## Why Deploy NarrowDB 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 NarrowDB 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

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

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