railway-domain

Add, view, and remove Railway service domains using the Railway CLI.

30.5k|3.5k|Updated Jul 4, 2025
One-click install
npx skills add https://github.com/davila7/claude-code-templates --skill railway-domain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: railway-domain
Source: https://github.com/davila7/claude-code-templates/tree/main/cli-tool/components/skills/railway/domain
Command: npx skills add https://github.com/davila7/claude-code-templates --skill railway-domain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires railway-cli.

What problem does it solve?

Managing domains for Railway services requires knowing the correct CLI commands, DNS record configuration, and GraphQL queries, which is error-prone when done manually.

Core Features & Use Cases

  • Generate Railway Domains: Create a Railway-provided domain for a service with a single CLI command, with JSON output for automation.
  • Add Custom Domains: Register a custom domain and receive the required DNS records (CNAME) to configure at your DNS provider.
  • Inspect and Remove Domains: Query configured service and custom domains via the environment config, and remove domains through the railway-environment skill.
  • Use Case: You just deployed a backend service on Railway and need a public URL. Use this Skill to generate a Railway domain, then later attach api.example.com and get the exact DNS records to add at your registrar.

Quick Start

Ask the AI to generate a Railway domain for your deployed service and show you the resulting URL.

Frequently Asked Questions about railway-domain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a domain to a Railway service?

Run railway domain --json to generate a Railway-provided domain, or railway domain example.com --json for a custom domain. Use the --service flag to target a specific service when none is linked.

How do I set up a custom domain on Railway?

Run railway domain with your custom domain and --json output. The response returns the required DNS records, typically a CNAME, which you add at your DNS provider to complete the setup.

How many Railway domains can a service have?

Each Railway service can have a maximum of one Railway-provided domain. Attempting to generate a second one returns an error stating the service already has a railway-provided domain.

Why does railway domain fail with no deployment error?

Domain generation requires the service to have an active deployment. Deploy the service first with railway up, then run the domain command to generate or attach a domain.

How do I remove a domain from a Railway service?

Domain removal is handled through the railway-environment skill by setting the domain entry to null under the service networking config, then applying and committing the environment change.