Deploy CockroachDB (Insecure mode)

SQL database designed for high availability, scalability and resilience.

Deploy CockroachDB (Insecure mode)

Just deployed

/cockroach/cockroach-data

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

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.


Template Content

More templates in this category

View Template
Postgres-to-R2 Backup
Auto back up PostgreSQL databases to Cloudflare R2 with optional encryption

View Template
ReadySet
A lightweight caching engine for Postgres

View Template
Simple S3
Deploy a S3-compatible storage service with a pre-named bucket.