railway-domain

Add, view, or remove domains for Railway services. Use when user wants to add a domain, generate a railway domain, check current domains, get the URL for a service, or remove a domain.

24,269 stars

Best use case

railway-domain is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Add, view, or remove domains for Railway services. Use when user wants to add a domain, generate a railway domain, check current domains, get the URL for a service, or remove a domain.

Teams using railway-domain should expect a more consistent output, faster repeated execution, less prompt rewriting, better workflow continuity with your supporting tools.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.
  • You already have the supporting tools or dependencies needed by this skill.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/domain/SKILL.md --create-dirs "https://raw.githubusercontent.com/davila7/claude-code-templates/main/cli-tool/components/skills/railway/domain/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/domain/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How railway-domain Compares

Feature / Agentrailway-domainStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Add, view, or remove domains for Railway services. Use when user wants to add a domain, generate a railway domain, check current domains, get the URL for a service, or remove a domain.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Railway Domain Management

Add, view, or remove domains for Railway services.

## When to Use

- User asks to "add a domain", "generate a domain", "get a URL"
- User wants to add a custom domain
- User asks "what's the URL for my service"
- User wants to remove a domain

## Add Railway Domain

Generate a railway-provided domain (max 1 per service):

```bash
railway domain --json
```

For a specific service:
```bash
railway domain --json --service backend
```

### Response
Returns the generated domain URL. Service must have a deployment.

## Add Custom Domain

```bash
railway domain example.com --json
```

### Response
Returns required DNS records:
```json
{
  "domain": "example.com",
  "dnsRecords": [
    { "type": "CNAME", "host": "@", "value": "..." }
  ]
}
```

Tell user to add these records to their DNS provider.

## Read Current Domains

Use railway-environment skill to see configured domains, or query directly:

```graphql
query domains($envId: String!) {
  environment(id: $envId) {
    config(decryptVariables: false)
  }
}
```

Domains are in `config.services.<serviceId>.networking`:
- `serviceDomains` - Railway-provided domains
- `customDomains` - User-provided domains

## Remove Domain

Use railway-environment skill to remove domains:

### Remove custom domain
```json
{
  "services": {
    "<serviceId>": {
      "networking": {
        "customDomains": { "<domainId>": null }
      }
    }
  }
}
```

### Remove railway domain
```json
{
  "services": {
    "<serviceId>": {
      "networking": {
        "serviceDomains": { "<domainId>": null }
      }
    }
  }
}
```

Then use railway-environment skill to apply and commit the change.

## CLI Options

| Flag | Description |
|------|-------------|
| `[DOMAIN]` | Custom domain to add (omit for railway domain) |
| `-p, --port <PORT>` | Port to connect |
| `-s, --service <NAME>` | Target service (defaults to linked) |
| `--json` | JSON output |

## Composability

- **Read domains**: Use railway-environment skill
- **Remove domains**: Use railway-environment skill
- **Apply removal**: Use railway-environment skill
- **Check service**: Use railway-service skill

## Error Handling

### No Service Linked
```
No service linked. Use --service flag or run `railway service` to select one.
```

### Domain Already Exists
```
Service already has a railway-provided domain. Maximum 1 per service.
```

### No Deployment
```
Service has no deployment. Deploy first with `railway up`.
```

### Invalid Domain
```
Invalid domain format. Use a valid domain like "example.com" or "api.example.com".
```

Related Skills

domain-driven-design

24269
from davila7/claude-code-templates

Plan and route Domain-Driven Design work from strategic modeling to tactical implementation and evented architecture patterns.

domain-name-brainstormer

24269
from davila7/claude-code-templates

Generates creative domain name ideas for your project and checks availability across multiple TLDs (.com, .io, .dev, .ai, etc.). Saves hours of brainstorming and manual checking.

railway-status

24269
from davila7/claude-code-templates

Check current Railway project status for this directory. Use when user asks "railway status", "is it running", "what's deployed", "deployment status", or about uptime. NOT for variables or configuration queries - use railway-environment skill for those.

railway-service

24269
from davila7/claude-code-templates

Check service status, rename services, change service icons, link services, or create services with Docker images. For creating services with local code, prefer railway-new skill. For GitHub repo sources, use railway-new skill to create empty service then railway-environment skill to configure source.

railway-docs

24269
from davila7/claude-code-templates

Fetch up-to-date Railway documentation to answer questions accurately. Use when user asks about Railway features, how Railway works, or shares a docs.railway.com URL.

railway-projects

24269
from davila7/claude-code-templates

List, switch, and configure Railway projects. Use when user wants to list all projects, switch projects, rename a project, enable/disable PR deploys, make a project public/private, or modify project settings.

railway-new

24269
from davila7/claude-code-templates

Create Railway projects, services, and databases with proper configuration. Use when user says "setup", "deploy to railway", "initialize", "create project", "create service", or wants to deploy from GitHub. Handles initial setup AND adding services to existing projects. For databases, use railway-railway-database skill instead.

railway-metrics

24269
from davila7/claude-code-templates

Query resource usage metrics for Railway services. Use when user asks about resource usage, CPU, memory, network, disk, or service performance like "how much memory is my service using" or "is my service slow".

railway-environment

24269
from davila7/claude-code-templates

Query, stage, and apply configuration changes for Railway environments. Use for ANY variable or env var operations, service configuration (source, build settings, deploy settings), lifecycle (delete service), and applying changes. Prefer over railway-status skill for any configuration or variable queries.

railway-deployment

24269
from davila7/claude-code-templates

Manage Railway deployments - view logs, redeploy, restart, or remove deployments. Use for deployment lifecycle (remove, stop, redeploy, restart), deployment visibility (list, status, history), and troubleshooting (logs, errors, failures, crashes). NOT for deleting services - use railway-environment skill with isDeleted for that.

railway-deploy

24269
from davila7/claude-code-templates

Deploy code to Railway using "railway up". Use when user wants to push code, says "railway up", "deploy", "ship", or "push". For initial setup or creating services, use railway-new skill. For Docker images, use railway-environment skill.

railway-database

24269
from davila7/claude-code-templates

Add official Railway database services (Postgres, Redis, MySQL, MongoDB). Use when user wants to add a database, says "add postgres", "add redis", "add database", "connect to database", or "wire up the database". For other templates (Ghost, Strapi, n8n), use the railway-templates skill.