Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

12 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš‚ railhq.io - Model Railway Headquarters

.NET Docker License Docs Security

railhq.io is a web-based control center for model railways. It provides a modern, browser-based interface to control locomotives, switches, signals, and more - all from any device on your network.

railhq.io Screenshot

โš ๏ธ Important Security Notice

Default credentials are set for quick start!

Username: free@railhq.io
Password: railhq.io

๐Ÿ”’ Please change these immediately after first login! See SECURITY.md for details.

โœจ Features

  • ๐ŸŽฎ Web-based Control - Control your model railway from any browser
  • ๐Ÿš‚ Multi-Protocol Support - Works with ESU ECoS, Roco/Fleischmann z21, and HSI-88-USB
  • ๐Ÿ“ฑ Responsive Design - Works on desktop, tablet, and mobile devices
  • ๐Ÿ”Œ Local Gateway - Connect your command stations via the railhq Gateway
  • ๐ŸŽจ Visual Track Plan - Create and edit your track layout visually
  • ๐Ÿค– Automation - Script-based automation for routes and sequences
  • ๐Ÿ‘ฅ Multi-User - Multiple users can control the layout simultaneously

๐Ÿ—๏ธ Architecture

The system consists of three main components:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Web Browser   โ”‚โ”€โ”€โ”€โ–ถโ”‚   railhq.io     โ”‚โ”€โ”€โ”€โ–ถโ”‚    Gateway      โ”‚
โ”‚   (Any Device)  โ”‚โ—€โ”€โ”€โ”€โ”‚   (Server)      โ”‚โ—€โ”€โ”€โ”€โ”‚   (Local PC)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                        โ”‚
                                                        โ–ผ
                                                โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                                โ”‚ Command       โ”‚
                                                โ”‚ Station       โ”‚
                                                โ”‚ (ECoS/z21)    โ”‚
                                                โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Components

Component Description Port
railyWebIndex User management, login, workspace selection 80/443 (via nginx)
railyWebApp Main application, track plan editor, control 5001
railyGateway Local gateway connecting to command stations 8090
Redis Session and cache storage 6379
nginx Reverse proxy 80, 443

๐Ÿš€ Quick Start

Prerequisites

Installation

# 1. Clone the repository
git clone https://github.com/cbries/railhq.io.git
cd railhq.io

# 2. Copy the example environment file
cp .env.example .env

# 3. Create data directories
mkdir -p ~/railhq.io/{resources,resourcesSetups,resourcesRedis,resourcesRuntime/nginx,resourcesRuntime/certificates,deployment}

# 4. Copy nginx configuration
cp resourcesRuntime/nginx/*.conf ~/railhq.io/resourcesRuntime/nginx/

# 5. Build and start
docker compose build railhq
docker compose up -d

Access

Open your browser and navigate to:

Default credentials:

Username: free@railhq.io
Password: railhq.io

โš ๏ธ CRITICAL SECURITY NOTICE: Change the default password immediately after first login! See SECURITY.md for important security information.

๐Ÿ“– Documentation

๐Ÿ”ง Configuration

Environment Variables

Variable Description Default
RAILHQ_DATA_DIR Base path for all data ~/railhq.io
RAILHQ_LOCAL_MODE Enable local/LAN mode true
RAILHQ_USE_TLS Enable HTTPS false
NGINX_CONF nginx config file nginx-http.conf

See .env.example for all available options.

Supported Command Stations

Manufacturer Model Status
ESU ECoS โœ… Full support
Roco/Fleischmann z21 โœ… Full support
LDT HSI-88-USB โœ… Feedback only

๐Ÿ› ๏ธ Development

Local Development Setup

# Prerequisites
# - .NET 8.0 SDK
# - Node.js (for documentation)
# - Redis (local or Docker)

# Start Redis for development
docker compose -f docker-compose-redis.yml up -d

# Build and run (from VS Code or terminal)
dotnet build
dotnet run --project WebApp/railyWebIndex
dotnet run --project WebApp/railyWebApp

Project Structure

railhq.io/
โ”œโ”€โ”€ Gateway/                 # Gateway application
โ”‚   โ”œโ”€โ”€ railyGateway/       # Main gateway
โ”‚   โ”œโ”€โ”€ railyEsuEcos/       # ESU ECoS driver
โ”‚   โ”œโ”€โ”€ railhqZ21/          # z21 driver
โ”‚   โ””โ”€โ”€ railyHsi88Usb/      # HSI-88-USB driver
โ”œโ”€โ”€ WebApp/
โ”‚   โ”œโ”€โ”€ railyWebIndex/      # Login & user management
โ”‚   โ””โ”€โ”€ railyWebApp/        # Main web application
โ”œโ”€โ”€ Libraries/              # Shared libraries
โ”œโ”€โ”€ resources/              # Themes, demo data
โ””โ”€โ”€ docker-compose.yml      # Docker configuration

๐Ÿณ Docker

Build Image

# Build with documentation (recommended)
./docker-build_and_export.sh

# Build and save as tar.gz for deployment
./docker-build_and_export.sh --save

Run Services

# Start all services
docker compose up -d

# View logs
docker compose logs -f

# Stop services
docker compose down

Backup & Restore

# Create backup
docker compose run --rm backup

# Restore resources
docker compose run --rm restoreResources

๐Ÿ—๏ธ Building Gateway Locally

Build Gateway binaries for all platforms:

# Build all variants (Windows, Linux, macOS, Raspberry Pi)
./build-gateway-local.sh

# Build specific variant
./build-gateway-local.sh linux-x64

# List available variants
./build-gateway-local.sh --list

# Clean old builds
./build-gateway-local.sh --clean

Available Variants

Runtime Platform Description
win-x64 Windows 64-bit Intel/AMD
win-arm64 Windows ARM64
linux-x64 Linux 64-bit Intel/AMD
linux-arm64 Linux ARM64 (Raspberry Pi 4)
linux-arm Linux ARM (Raspberry Pi 3)
osx-x64 macOS Intel
osx-arm64 macOS Apple Silicon

๐Ÿ”„ CI/CD Pipelines

This project uses GitHub Actions for automated builds:

Workflow Trigger Output
docker-build.yml Push to main, Tags v* Docker Image โ†’ GHCR + Release
build-gateway.yml Tags v* Gateway Binaries (all platforms)

Docker Image

# Pull from GitHub Container Registry
docker pull ghcr.io/cbries/railhq.io:latest

# Or load from release tar.gz
gunzip -c railhq.io-1.64.tar.gz | docker load

๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for guidelines.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Copyright (c) 2025 Dr. Christian Benjamin Ries

๐Ÿ”’ Security

For security concerns, please review our Security Policy.

To report vulnerabilities, contact: mail@cbries.de

๐Ÿ™ Acknowledgments

  • ESU for the ECoS command station
  • Roco/Fleischmann for the z21 command station
  • LDT for the HSI-88-USB interface
  • The model railway community

Made with โค๏ธ for the model railway community

About

๐Ÿš‚ Web-based control center for model railways - ESU ECoS, Roco z21, HSI-88-USB

Topics

Resources

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Used by

Contributors

Languages