---
title: "Deploy Happy Server"
description: "Self-hosted relay for Happy, the mobile client for Claude Code and Codex"
category: "AI/ML"
url: https://railway.com/deploy/happy-server
---

# Deploy Happy Server

Self-hosted relay for Happy, the mobile client for Claude Code and Codex

**[Deploy Happy Server on Railway](https://railway.com/template/happy-server)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/happy-server/manifest.json

- **Creator:** My Projects
- **Category:** AI/ML

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Happy Server https://github.com/slopus.png

- **Source:** slopus/happy
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Happy Server on Railway

[Happy](https://github.com/slopus/happy) lets you run Claude Code and Codex sessions on your computer and control them from your phone, the web or desktop, with end-to-end encryption. Happy Server is the relay and sync backend between the `happy` CLI on your machine and the Happy apps. This template runs your own copy instead of the public Happy Cloud.

## About Hosting Happy Server

This template builds the official production server (`Dockerfile.server`, the Rust server) from the repository and runs it next to a private Postgres:

- Happy Server on port 3000 with a public domain
- Postgres with a persistent volume, reachable only over the private network
- Database migrations run in a pre-deploy step on every deploy
- A persistent volume at /data for uploaded files (no S3 needed)
- HANDY_MASTER_SECRET generated per deployment

The first build compiles the Rust server and takes several minutes.

**After deploy:**

1. Open https://YOUR-RAILWAY-DOMAIN/health; it should return {"status":"ok"}.
2. On your computer, point the CLI at your server: set `HAPPY_SERVER_URL=https://YOUR-RAILWAY-DOMAIN` (or `serverUrl` in `~/.happy/settings.json`), then run `happy` or `happy daemon start` and pair as usual.
3. In the Happy app, open Settings, set the Custom Server URL to `https://YOUR-RAILWAY-DOMAIN`, then sign in or pair.
4. Session content is end-to-end encrypted on your devices; the server stores ciphertext.
5. Optional: voice needs ELEVENLABS_API_KEY, and GitHub login needs the GITHUB_* variables described in the upstream docs.

## Common Use Cases

- Control Claude Code or Codex sessions on your workstation from your phone
- Keep session sync and metadata on infrastructure you control
- Give a small team a private Happy backend
- Run Happy where the public cloud is blocked or not allowed

## Dependencies for Happy Server Hosting

- Source: https://github.com/slopus/happy (MIT license)
- PostgreSQL (included)
- The Happy CLI (`npm i -g happy`) and the Happy apps on your devices

### Deployment Dependencies

- https://github.com/slopus/happy
- https://github.com/slopus/happy/blob/main/docs/deployment.md

### Implementation Details

- The Rust server is one process per database (it holds a Postgres advisory lock), so keep the service at one replica.
- Redis is not needed by the Rust server, and without S3_HOST files are stored under DATA_DIR on the volume.
- HANDY_MASTER_SECRET derives auth and encryption keys; rotating it signs everyone out and breaks stored keys.
- Metrics are off; set METRICS_ENABLED=true and METRICS_PORT to expose Prometheus metrics on a separate port.

## Why Deploy Happy Server 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 Happy Server 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.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/happy-server
