Railway

Deploy Grok Mirror

Deploy your personal Grok mirror site with one click

Deploy Grok Mirror

dairoot/grok-gateway:latest

dairoot/grok-gateway:latest

Just deployed

/app/.cache_data

Deploy and Host Grok Mirror on Railway

Grok Mirror is an open-source self-hosted Grok mirror platform that enables multiple users to securely share and manage Grok accounts through a unified web interface. It provides the same experience as the official Grok website while exposing an OpenAI-compatible Chat Completions API for applications, AI clients, and automation tools.

About Hosting Grok Mirror

Deploying Grok Mirror on Railway provides a simple way to self-host a multi-user Grok gateway without managing servers or infrastructure. Railway automatically provisions HTTPS, networking, and persistent storage while Grok Mirror lets you manage multiple Grok SSO tokens, user access, and API authentication through an intuitive web interface. Once deployed, simply add your Grok SSO token(s), configure optional API authentication, and begin using both the web UI and the OpenAI-compatible API endpoint from your own Railway domain.

Common Use Cases

  • Share Grok access with multiple users or team members.
  • Expose an OpenAI-compatible API backed by Grok.
  • Rotate multiple Grok SSO tokens automatically.
  • Self-host a private Grok web interface.
  • Connect Grok to Open WebUI, LobeChat, ChatGPT Next Web, and custom AI applications.

Dependencies for Grok Mirror Hosting

The Railway template automatically deploys everything required.

Required Environment Variables

VariableDescription
ADMIN_PASSWORDPassword used to access the administration panel.
AUTHORIZATIONAPI authorization key used for OpenAI-compatible API authentication and automatic SSO token rotation.

Optional Environment Variables

VariableDescriptionDefault
ENABLE_MIRROR_APIEnable OpenAI-compatible API.true
MIRROR_API_PREFIXCustom API prefix for additional security.None
API_HATDEnable temporary chat mode for API requests.true
PROXY_URL_POOLHTTP/SOCKS5 proxy pool.None
HOSTPublic domain of your Railway deployment.None
GOOGLEADSGoogle AdSense publisher code.None

No external database is required.

Persistent storage is automatically included to preserve Grok SSO tokens and application data across deployments.

Deployment Dependencies

Configuration

After deployment:

  1. Open your Railway deployment URL.
  2. Log in using the configured ADMIN_PASSWORD.
  3. Add one or more Grok SSO Tokens.
  4. Configure the optional API authorization key.
  5. Start using the web interface or the OpenAI-compatible API.

The application exposes an OpenAI-compatible endpoint:

/v1/chat/completions

compatible with OpenAI SDKs, Open WebUI, LobeChat, ChatGPT Next Web, and other OpenAI-compatible clients.

How to Obtain Your Grok SSO Token

How to Get Grok SSO Token

  1. Sign in to your Grok account:

    https://grok.com/

  2. Press F12 to open Developer Tools.

  3. Open the Application (Chrome/Edge) or Storage (Firefox) tab.

  4. Under Cookies, select:

    https://grok.com
    
  5. Locate the cookie named:

    sso
    
  6. Copy its value.

  7. Paste the SSO token into the Grok Mirror administration panel.

You can add multiple SSO tokens for automatic account rotation.

Railway Deployment Settings

SettingValue
DeploymentDocker Image
Docker Imagedairoot/grok-gateway:latest
HTTP ProxyEnabled
Target Port8080
Persistent Volume/app/.cache_data

Troubleshooting

"Application failed to respond"

If your Railway deployment displays Application failed to respond, the most common cause is an invalid or stale public domain.

Try the following:

  1. Open your Railway service.
  2. Go to Networking.
  3. Delete the existing generated domain.
  4. Click Generate Domain to create a new Railway domain.
  5. Wait a few seconds and refresh the page.

If the issue persists, check the deployment logs to verify the application has started successfully.

Features

  • Multi-user Grok web interface
  • OpenAI-compatible Chat API
  • Multiple Grok account support
  • Automatic SSO token rotation
  • API authentication
  • Proxy support
  • Responsive web dashboard
  • Persistent account storage

Why Deploy Grok Mirror 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 Grok Mirror 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

dairoot/grok-gateway:latest

dairoot/grok-gateway:latest

More templates in this category

View Template
Rocky Linux
[Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
17
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
47