Railway

Deploy StarRocks

MySQL-compatible MPP analytics database for real-time queries at scale

Deploy StarRocks

Just deployed

Deploy and Host StarRocks on Railway

StarRocks is an open-source MPP analytical database built for sub-second queries on billions of rows. It is a ClickHouse alternative that speaks the MySQL wire protocol — every MySQL client, driver, and BI tool connects to it with no special integration work — and it supports real-time updates, high-concurrency serving, and querying data-lake tables in place.

About Hosting StarRocks

This template deploys a single-service StarRocks cluster:

  • Frontend + Backend in one service: metadata, query planning, storage, and execution, packaged in the official all-in-one image and bootstrapped automatically on first boot
  • MySQL-protocol endpoint: connect with mysql, DBeaver, TablePlus, Metabase, Superset, or any MySQL driver through Railway's TCP Proxy
  • HTTP endpoint: the FE web UI, REST API, and Stream Load ingestion, served on the public domain through a bundled nginx proxy that resolves StarRocks' internal redirects
  • Secured by default: the root password is generated by Railway at install time and applied to the account on first boot, with the public endpoint held offline until it is in place
  • Persistent storage: a Railway volume holds catalog metadata and table data across redeployments
  • Version control: pick a StarRocks release with a single variable, from latest to the LTS line to a pinned version

Getting Started After Deployment

Accessing the Web UI

Click the StarRocks service to find your URL:

  1. Deployments Tab: the URL is displayed directly under the service name
  2. Settings > Networking: go to the Settings tab → scroll to Networking → find Public Networking

Opening it prompts for a username and password:

FieldValue
Usernameroot
PasswordThe value of the STARROCKS_PASSWORD variable

There is no username variable to set. StarRocks' superuser account is always named root — the template only generates its password. The same root + STARROCKS_PASSWORD pair is used for the web UI, SQL clients, and Stream Load.

First boot takes a few minutes. The image is large, the cluster registers its backend before accepting connections, and the public URL is deliberately held offline until the generated root password has been applied — otherwise the web UI would briefly accept root with no password. The service is ready when the logs read public HTTP enabled.

Finding Your Password

  1. Open your Railway project dashboard
  2. Click the StarRocks service
  3. Go to the Variables tab
  4. Find STARROCKS_PASSWORD — click the eye icon to reveal it

Connecting SQL Clients

Queries run over the MySQL protocol on port 9030. That is a raw TCP port, not HTTP, so it is reached through a Railway TCP Proxy rather than the public HTTPS domain.

  1. Click the StarRocks service and open the Settings tab
  2. Scroll to NetworkingPublic Networking
  3. Under Connect to your service over TCP using a proxied domain and port, click TCP Proxy
  4. Enter 9030 as the port your service listens on
  5. Railway generates a host and port, shown as .proxy.rlwy.net: — for example sakura.proxy.rlwy.net:26024

Connect with those values, user root, and your STARROCKS_PASSWORD:

mysql -h .proxy.rlwy.net -P  -u root -p

The host and port both come from the TCP Proxy panel. Use the generated port, not 9030 — 9030 is the internal port the proxy forwards to.

Any MySQL-compatible client works — DBeaver, TablePlus, Metabase, Superset, or a MySQL driver in your language of choice — using the MySQL driver with that host, port, user, and password.

One client caveat: MySQL 9.x command-line clients removed the mysql_native_password plugin that StarRocks authenticates with, and fail with ERROR 2059 (HY000): Authentication plugin 'mysql_native_password' cannot be loaded no matter how correct the password is. Use a MySQL 8.x or MariaDB client:

# macOS, alongside an existing newer install
brew install mysql-client@8.0
/opt/homebrew/opt/mysql-client@8.0/bin/mysql -h .proxy.rlwy.net -P  -u root -p

# or with no local install at all
docker run --rm -it mysql:8.0 mysql -h .proxy.rlwy.net -P  -u root -p

GUI clients bundle their own drivers and are unaffected.

Verify the connection end to end:

SELECT current_version();
SHOW BACKENDS\G   -- one backend, Alive: true

Loading Data

Stream Load works against the public HTTPS domain:

curl --location-trusted -u root: \
  -H "label:load-001" -H "Expect:100-continue" \
  -H "column_separator:," -H "columns: id, name, score" \
  -T data.csv -XPUT \
  https:///api///_stream_load

You can also load with INSERT INTO, or read directly from S3, Iceberg, Hive, Hudi, and Delta Lake through external catalogs.

Common Use Cases

  • Real-time analytics dashboards over freshly ingested event data
  • User-facing analytics where many concurrent queries must return in under a second
  • Log and clickstream analysis with fast aggregations on high-cardinality dimensions
  • A lakehouse query engine over Iceberg, Hudi, Delta Lake, and Hive tables
  • Replacing multi-stage batch ETL with direct queries and materialized views
  • Business intelligence backends for Metabase, Superset, Tableau, and Looker

Dependencies for StarRocks Hosting

  • Docker (the service runs as a container)

Deployment Dependencies

Services

ServiceSourceDescription
StarRocksCustom DockerfileFrontend + Backend single-node cluster (public)

Environment Variables

VariableDescription
STARROCKS_PASSWORDPassword for the root account (${{secret(32)}} auto-generates)
STARROCKS_IMAGE_TAGDocker image tag for version control (default: latest)
STARROCKS_BE_MEM_LIMITBackend memory ceiling, percentage or absolute (default: 80%)
PORTRailway-assigned HTTP port for the web UI and ingestion endpoint (auto-configured)

Volume

ServiceMount PathPurpose
StarRocks/var/lib/starrocksCatalog metadata and table data

Key Features

MySQL Compatibility

StarRocks speaks the MySQL wire protocol and standard SQL, including joins and window functions. Existing clients, drivers, and BI tools work unchanged — there is no proprietary query language to learn.

Sub-Second Analytics at Scale

A vectorized execution engine, columnar storage, and a cost-based optimizer deliver fast aggregations over billions of rows, with the concurrency needed to put analytics in front of end users rather than just analysts.

Real-Time Updates

Primary-key tables support upserts and deletes with minimal read overhead, so continuously changing data stays queryable without rebuild jobs.

Lakehouse Queries

External catalogs query Iceberg, Hudi, Delta Lake, Hive, and JDBC sources in place — join lake tables with local tables in a single query, no copy required.

Version Flexibility

Switch StarRocks versions by changing STARROCKS_IMAGE_TAGlatest, the LTS line, or a pinned release — with no code changes.

Persistent Storage

A Railway volume keeps catalog metadata and table data across redeploys and restarts.

Why Deploy StarRocks 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 StarRocks on Railway, you get an analytical database with a web UI, a MySQL-compatible SQL endpoint, HTTP ingestion, and persistent storage — configured and ready to query. Host your servers, databases, AI agents, and more 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 StarRocks is an open-source MPP analytical database built for sub-second queries on billions of rows. 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
Matomo Analytics + MariaDB
Privacy-friendly analytics with MariaDB and persistent volumes.

leodev
1
View Template
Bugsink
Self-hosted Error Tracking. Sentry-SDK compatible

zǝʇɹoɔ oɓıɹpoɹ
18
View Template
SubTrackr
Self-hosted Subscription Tracker

amnesia
3