---
title: "Deploy CLI Proxy API (Self-Hosted)"
description: "Self-host CLIProxyAPI with persistent accounts and sticky sessions."
category: "AI/ML"
url: https://railway.com/deploy/cliproxyapi-self-hosted
---

# Deploy CLI Proxy API (Self-Hosted)

Self-host CLIProxyAPI with persistent accounts and sticky sessions.

**[Deploy CLI Proxy API (Self-Hosted) on Railway](https://railway.com/template/cliproxyapi-self-hosted)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/cliproxyapi-self-hosted/manifest.json

- **Creator:** Hosmel Quintana's Projects
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### CLI Proxy API https://raw.githubusercontent.com/router-for-me/Cli-Proxy-API-Management-Center/main/logo.jpg

- **Image:** ghcr.io/hosmelq/railway-cliproxyapi-template:latest
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host CLI Proxy API (Self-Hosted) on Railway

CLI Proxy API connects Claude Code, Codex, and other supported provider accounts to compatible API endpoints. This template includes persistent storage, generated access keys, and a web interface for managing accounts.

## About Hosting CLI Proxy API (Self-Hosted)

The template deploys one service with an HTTPS domain and a persistent `/data` volume. Configuration and accounts survive redeployments. Session affinity keeps conversations on the same account, with automatic failover when another eligible account is available.

## Common Use Cases

- Connect coding tools from multiple computers.
- Manage several provider accounts in one place.
- Use one endpoint for Claude Code and Codex.

## Dependencies for CLI Proxy API (Self-Hosted) Hosting

- Persistent storage, included in this template.
- Your own supported provider accounts or API credentials.

### Implementation Details

After deployment, open `/management.html` and sign in with `MANAGEMENT_PASSWORD` from Railway’s variables. Connect your accounts, then configure your clients with `CLIPROXY_API_KEY` and the service URL. Codex uses the URL followed by `/v1`.

See the [source repository](https://github.com/hosmelq/railway-cliproxyapi-template) and setup guides for [Claude Code](https://help.router-for.me/agent-client/claude-code) and [Codex](https://help.router-for.me/agent-client/codex).

## Why Deploy CLI Proxy API (Self-Hosted) 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 CLI Proxy API (Self-Hosted) 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

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/cliproxyapi-self-hosted
