Deploy StarRocks
MySQL-compatible MPP analytics database for real-time queries at scale
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
rootpassword 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
latestto the LTS line to a pinned version
Getting Started After Deployment
Accessing the Web UI
Click the StarRocks service to find your URL:
- Deployments Tab: the URL is displayed directly under the service name
- Settings > Networking: go to the Settings tab → scroll to Networking → find Public Networking
Opening it prompts for a username and password:
| Field | Value |
|---|---|
| Username | root |
| Password | The 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
- Open your Railway project dashboard
- Click the StarRocks service
- Go to the Variables tab
- 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.
- Click the StarRocks service and open the Settings tab
- Scroll to Networking → Public Networking
- Under Connect to your service over TCP using a proxied domain and port, click TCP Proxy
- Enter
9030as the port your service listens on - Railway generates a host and port, shown as
.proxy.rlwy.net:— for examplesakura.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
| Service | Source | Description |
|---|---|---|
| StarRocks | Custom Dockerfile | Frontend + Backend single-node cluster (public) |
Environment Variables
| Variable | Description |
|---|---|
STARROCKS_PASSWORD | Password for the root account (${{secret(32)}} auto-generates) |
STARROCKS_IMAGE_TAG | Docker image tag for version control (default: latest) |
STARROCKS_BE_MEM_LIMIT | Backend memory ceiling, percentage or absolute (default: 80%) |
PORT | Railway-assigned HTTP port for the web UI and ingestion endpoint (auto-configured) |
Volume
| Service | Mount Path | Purpose |
|---|---|---|
| StarRocks | /var/lib/starrocks | Catalog 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_TAG — latest, 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
StarRocks
nick0lay/railway-templates