---
title: "Deploy Alma Relay"
description: "Self-hosted relay for Alma Remote Access, phone to desktop"
category: "Other"
url: https://railway.com/deploy/deploy-alma-relay-remote-access
---

# Deploy Alma Relay

Self-hosted relay for Alma Remote Access, phone to desktop

**[Deploy Alma Relay on Railway](https://railway.com/template/deploy-alma-relay-remote-access)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-alma-relay-remote-access/manifest.json

- **Creator:** onepush
- **Category:** Other

## Template content

### alma-relay

- **Image:** ghcr.io/onepush-dev/alma-relay:1.4.0
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host self hosted Alma Relay (Remote Access) on Railway

This template deploys the open-source Alma Relay as one Railway service, so the phone-to-desktop link for Alma Remote Access runs on infrastructure you control.

## About Hosting Alma Relay open-source software on Railway (self hosted Alma Relay template)

Alma Relay is MIT-licensed software, and this template runs the unmodified upstream image as one stateless Node service on Railway.

Railway handles HTTPS, WebSocket termination, the public domain, and the /healthz health check.

## Why Deploy Alma Relay, the self-hosted relay for Alma Remote Access on Railway (Railway Free Trial)

Alma ships a hosted relay at relay.alma.now. Running your own keeps phone-to-desktop Alma traffic on infrastructure you control.

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 Alma Relay 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.

### Railway vs Other Hosting Providers and VPS for Alma Relay self hosting

Railway runs the relay as a managed one-click deploy, while these providers leave more setup to you.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | One stateless relay service from a template, with a generated registration key and health check. | A Droplet you control, but you install Docker, set up a proxy, and manage certificates. |
| AWS | One service deployed from a template, with Railway handling public HTTPS for the relay. | Wide networking control, but more setup across instances, security groups, and certificates. |
| Hetzner | A managed deploy path with no SSH, firewall rules, or manual Docker upkeep. | Low-cost servers where you run the upstream compose file and handle updates yourself. |

Pick a VPS for full host control, and Railway for a quicker setup with less upkeep.

## Common Use Cases for hosted Alma Relay

- **Reaching your desktop Alma from your phone without port forwarding or a VPN:** Your desktop dials out to the relay and keeps the connection open, so no router changes or VPN are needed.
- **Keeping relay traffic off the hosted relay.alma.now:** Point Alma at your own domain instead of the default hosted server.
- **Running a relay in a region closer to you:** Picking a nearby Railway region can reduce latency for streamed responses and WebSocket sessions.
- **Running a team relay with per-user tokens:** Set RELAY_TOKEN_SECRET and mint a token per person, so you can revoke one person without rotating others' credentials.

## Dependencies for Alma Relay Docker hosted on Railway

This template runs one service built on the official Alma Relay image. It listens on port 8080 behind Railway's HTTPS domain.

### Deployment Dependencies for Managed Alma Relay Service (one stateless Node service, no volume, nothing written to disk)

The template deploys one service named alma-relay with no volume, a /healthz health check, and a restart policy of always.

### Implementation Details for Alma Relay (ghcr.io/onepush-dev/alma-relay:1.4.0 is the unmodified upstream image with HOST=:: and PORT=8080; upstream Caddy and coturn compose services are omitted because Railway terminates TLS and offers no UDP)

The service runs ghcr.io/onepush-dev/alma-relay:1.4.0, built from the upstream image with HOST=:: and PORT=8080 set.

## How does Alma Relay compare against other tools

### Alma Relay vs relay.alma.now (Alma Hosted Relay Alternative)

- **Who runs it:** Alma runs relay.alma.now. Alma Relay runs on your own domain and registration key.
- **Traffic and privacy:** With end-to-end encryption on, the default for new pairings, both only handle ciphertext. Use Alma 0.4.329 or later.
- **Trade-off:** The hosted relay needs no setup. Alma Relay keeps traffic on your server.

### Alma Relay vs the Cloudflare Workers Edition (Serverless Relay Alternative)

- **Hosting model:** Upstream Option A runs on Cloudflare Workers free with no server. The Railway template runs the Node edition as one long-lived service.
- **Persistence:** Neither writes tunnel state to disk. The Railway service has no volume and runs one replica.
- **Where it wins:** The Workers edition needs no container host. Alma Relay suits people who want a plain Node process they can inspect.

### Alma Relay vs a VPN such as Tailscale (VPN Remote Access Alternative)

- **Connection model:** A VPN joins your phone and desktop to a private network. Alma Relay has the desktop dial out, so no port forwarding or VPN client is needed.
- **Scope:** A VPN gives general network access. The relay carries only Alma Remote Access traffic.
- **Where it wins:** A VPN also reaches other desktop services.

### Alma Relay with Docker vs Railway (Docker Hosting Alternative)

- **Setup effort:** Docker on a VPS means managing TLS, DNS and firewall rules yourself. Railway handles HTTPS and WebSockets.
- **Live view limits:** Railway offers no UDP, so the upstream coturn service is omitted. A self-managed Docker host lets you add TURN.
- **Where it wins:** A self-managed Docker host gives full port and TURN control. Railway is faster to a working relay.

## How to use Alma Relay on Railway?

1. On the desktop, open Alma and go to Settings, then Remote Access.
2. Click Use a self-hosted relay, enter https://your-domain (the public address Railway gave your service), and click Use this relay.
3. Open the service Variables tab on Railway and copy RELAY_REGISTRATION_KEY. Back in Alma, go to the Alma account section, choose Paste a token manually, and paste the key there.
4. Scan the pairing QR code with the Alma app on your phone. The pairing link carries the relay address, so the phone needs no other setup.
5. If you paired a phone with a different relay earlier, scan the QR code again. Phones paired to another relay do not switch over on their own.
6. Confirm the relay is up by requesting the health endpoint. A healthy service returns a short JSON response:

```
curl https://your-domain/healthz
```

If the desktop cannot register, check the key matches exactly and the health endpoint responds.

## How to self host Alma Relay on other VPS Services (Alma Relay self hosting guide)

### Clone the Repository

On a server with ports 80 and 443 open and a DNS record pointing at it, clone the upstream project:

```bash
git clone https://github.com/yetone/alma-relay && cd alma-relay
```

### Install Dependencies

You need Docker with the Compose plugin. Without Docker, the upstream project also runs on Node 20 or later.

### Configure Environment Variables

Copy the example file and set your public hostname. Every other variable is optional:

```bash
cp .env.example .env
# set RELAY_DOMAIN=your-domain in .env
```

Leave `RELAY_REGISTRATION_KEY` empty for a personal relay, or set it to a shared key so strangers can't use your server.

### Start the Alma Relay Application

Bring the stack up. Caddy obtains and renews the HTTPS certificate on its own:

```bash
docker compose up -d
```

Add `--profile turn` only if you want coturn for the phone's live browser view.

Upstream Option C, an alternative to Compose: run the image behind your own reverse proxy that allows WebSockets and disables response buffering:

```bash
docker run -d --restart unless-stopped -p 127.0.0.1:8787:8787 ghcr.io/yetone/alma-relay:1.4.0
```

Check it with `curl https://your-domain/healthz`. On Railway, the platform handles HTTPS, the proxy, and the process lifecycle for you.

## Official Pricing of Alma Relay (Alma Relay pricing)

Alma Relay is MIT-licensed open-source software, and the relay itself is free to self-host.

## Alma Relay hosted vs self hosted comparison (Pricing, features, costs, and more)

Alma ships a hosted relay at relay.alma.now.

### Monthly cost of self hosting Alma Relay on Railway

Railway bills by usage, so cost depends on the RAM and CPU of this stateless Node service plus other project services. There is no volume.

### System Requirements for Hosting Alma Relay on a VPS

On a VPS you supply the server, which needs Docker and a reverse proxy that allows WebSockets and disables response buffering.

## Frequently Asked Questions (FAQs)

### Does the relay see my traffic?

With end-to-end encryption on, the Alma default for new pairings, the relay only sees ciphertext. Use Alma 0.4.329 or later, since earlier desktops still answer plaintext requests.

### Why is there no live browser view on the phone?

The live view runs over WebRTC, and that needs TURN, which requires UDP that Railway doesn't offer. Point `TURN_URLS` and `TURN_SECRET` at an external TURN server if you need it.

### Do push notifications work?

Not to the official Alma iOS app from a self-hosted relay, because Apple only accepts notifications from the key of the team that signs the app. Android notifications need your own Firebase project.

### How do I share the relay with a team?

Set `RELAY_TOKEN_SECRET` and mint a token per person with `node scripts/mint-token.mjs USER DAYS` run over `railway ssh`. Per-user tokens take precedence over the shared key, and rotating the secret revokes all issued tokens.

### What is stored on the relay?

Codes, tokens and traffic are never written to disk or logs, and the relay never sees your connect code, as upstream documents. The service is stateless and has no volume. This is independent community packaging, not affiliated with or endorsed by Alma or its author, and the relay is only useful with the separate Alma desktop and phone apps.

### What if my registration key leaks?

Someone could register desktops on your relay but still needs your connect code to reach one. Rotate `RELAY_REGISTRATION_KEY` and redeploy.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/deploy-alma-relay-remote-access
