---
title: "Deploy CockroachDB (Insecure mode)"
description: "SQL database designed for high availability, scalability and resilience."
category: "Storage"
url: https://railway.com/deploy/cockroachdb-insecure-mode
---

# Deploy CockroachDB (Insecure mode)

SQL database designed for high availability, scalability and resilience.

**[Deploy CockroachDB (Insecure mode) on Railway](https://railway.com/template/cockroachdb-insecure-mode)**

- **Creator:** Medim's Projects
- **Category:** Storage

## Template content

### CockroachDB https://styles.redditmedia.com/t5_34jcf/styles/communityIcon_cajxo1o16pj61.png

- **Image:** cockroachdb/cockroach
- **Start command:** `cockroach start-single-node --insecure --store=/cockroach/cockroach-data --sql-addr=0.0.0.0:26257 --listen-addr=0.0.0.0:26258 --http-addr=0.0.0.0:8080 --cache=64MiB --max-sql-memory=128MiB`
- **Health check:** /health?ready=1
- **Public domain:** Yes

## Documentation

# Deploy and Host CockroachDB (Insecure mode) on Railway

CockroachDB is a resilient, PostgreSQL‑compatible distributed SQL database built for correctness and scale. This template runs a single node in insecure mode for development and testing on Railway: data persists on a volume, SQL is reachable via a TCP proxy, and the Admin UI is publicly available on port 8080.

## About Hosting CockroachDB (Insecure mode)

This template provisions a self‑hosted CockroachDB container with a persistent volume, starts the node with the `--insecure` flag (no TLS and no authentication), exposes the Admin UI publicly on port 8080, and makes the SQL port (26257) reachable through Railway’s TCP proxy. It is intended for non‑production use such as local development, demos, or CI environments. In insecure mode, anyone who can reach the service can access your cluster. For production, use a secure, multi‑node CockroachDB deployment with TLS and role‑based authentication. Learn more in the official docs: https://www.cockroachlabs.com/docs/v25.4/deploy-cockroachdb-on-premises-insecure

Important: Insecure mode allows the following:
- Your cluster is open to any client that can access any node's IP addresses.
- Any user, even root, can log in without providing a password.
- Any user, connecting as root, can read or write any data in your cluster.
- There is no network encryption or authentication, and thus no confidentiality.

## Common Use Cases

- Develop and test PostgreSQL‑compatible apps against CockroachDB
- Explore the Admin UI and SQL features for learning and demos
- Short‑lived staging or CI smoke tests with non‑sensitive data

## Dependencies for CockroachDB (Insecure mode) Hosting

- Railway project and service with an attached persistent volume
- Railway TCP Proxy for SQL port 26257 and a Public Domain for the Admin UI (8080)
- A Postgres‑compatible client (psql) or the cockroach SQL shell to connect

### Deployment Dependencies

- CockroachDB: Deploy on‑premises (insecure) guide  
  https://www.cockroachlabs.com/docs/v25.4/deploy-cockroachdb-on-premises-insecure

### Implementation Details 

- Admin UI: http://:8080
- Connect with psql:
  ```
  psql "postgresql://root@:/defaultdb?sslmode=disable"
  ```
- Connect with cockroach SQL shell:
  ```
  cockroach sql --insecure --host= --port=
  ```

(Or use the provided `DATABASE_URL_PRIVATE` and `DATABASE_URL_PUBLIC` env vars)

## Why Deploy CockroachDB (Insecure mode) 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 CockroachDB (Insecure mode) 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/cockroachdb-insecure-mode
