templates by railwayapp/railway-skills
npx skills add https://github.com/railwayapp/railway-skills --skill templates从 Railway 的模板市场中搜索并部署服务。
| 类别 | 模板 | 代码 |
|---|---|---|
| 数据库 | PostgreSQL | postgres |
| Redis | redis | |
| MySQL | mysql | |
| MongoDB |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
mongodb |
| CMS | Ghost | ghost |
| Strapi | strapi |
| 存储 | Minio | minio |
| 自动化 | n8n | n8n |
| 监控 | Uptime Kuma | uptime-kuma |
对于其他模板,请使用下面的搜索查询。
获取项目上下文:
railway status --json
提取:
id - 项目 IDenvironments.edges[0].node.id - 环境 ID获取工作区 ID:
bash <<'SCRIPT'
scripts/railway-api.sh \
'query getWorkspace($projectId: String!) {
project(id: $projectId) { workspaceId }
}' \
'{"projectId": "PROJECT_ID"}'
SCRIPT
列出可用模板,可使用可选过滤器:
bash <<'SCRIPT'
scripts/railway-api.sh \
'query templates($first: Int, $verified: Boolean) {
templates(first: $first, verified: $verified) {
edges {
node {
name
code
description
category
}
}
}
}' \
'{"first": 20, "verified": true}'
SCRIPT
| 参数 | 类型 | 描述 |
|---|---|---|
first | Int | 结果数量(最多约 100 条) |
verified | Boolean | 仅限已验证的模板 |
recommended | Boolean | 仅限推荐的模板 |
每分钟 10 个请求。请勿频繁搜索。
通过代码获取特定模板:
bash <<'SCRIPT'
scripts/railway-api.sh \
'query template($code: String!) {
template(code: $code) {
id
name
description
serializedConfig
}
}' \
'{"code": "postgres"}'
SCRIPT
返回:
id - 模板 ID(部署时需要)serializedConfig - 服务配置(部署时需要)bash <<'SCRIPT'
scripts/railway-api.sh \
'query template($code: String!) {
template(code: $code) {
id
serializedConfig
}
}' \
'{"code": "postgres"}'
SCRIPT
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation deployTemplate($input: TemplateDeployV2Input!) {
templateDeployV2(input: $input) {
projectId
workflowId
}
}' \
'{
"input": {
"templateId": "TEMPLATE_ID_FROM_STEP_1",
"serializedConfig": SERIALIZED_CONFIG_FROM_STEP_1,
"projectId": "PROJECT_ID",
"environmentId": "ENVIRONMENT_ID",
"workspaceId": "WORKSPACE_ID"
}
}'
SCRIPT
重要提示: serializedConfig 是模板查询返回的确切 JSON 对象,而不是字符串。
部署模板后,使用引用变量连接其他服务。
关于完整的变量语法和连接模式,请参阅 variables.md。
${{ServiceName.VARIABLE_NAME}}
| 服务 | 连接变量 |
|---|---|
| PostgreSQL (Postgres) | ${{Postgres.DATABASE_URL}} |
| Redis | ${{Redis.REDIS_URL}} |
| MySQL | ${{MySQL.MYSQL_URL}} |
| MongoDB | ${{MongoDB.MONGO_URL}} |
后端服务 可以使用私有 URL(内部网络):
${{Postgres.DATABASE_URL}}
前端应用程序 在浏览器中运行,无法访问 Railway 的私有网络。可选方案:
${{MongoDB.MONGO_PUBLIC_URL}})bash <<'SCRIPT'
# 1. 获取上下文
railway status --json
# → project.id = "proj-123", environment.id = "env-456"
# 2. 获取工作区 ID
scripts/railway-api.sh \
'query { project(id: "proj-123") { workspaceId } }' '{}'
# → workspaceId = "ws-789"
# 3. 获取 Postgres 模板
scripts/railway-api.sh \
'query { template(code: "postgres") { id serializedConfig } }' '{}'
# → id = "template-abc", serializedConfig = {...}
# 4. 部署
scripts/railway-api.sh \
'mutation deploy($input: TemplateDeployV2Input!) {
templateDeployV2(input: $input) { projectId workflowId }
}' \
'{"input": {
"templateId": "template-abc",
"serializedConfig": {...},
"projectId": "proj-123",
"environmentId": "env-456",
"workspaceId": "ws-789"
}}'
SCRIPT
bash <<'SCRIPT'
# 搜索已验证的模板
scripts/railway-api.sh \
'query {
templates(first: 50, verified: true) {
edges {
node { name code description category }
}
}
}' '{}'
# 按 "CMS" 类别筛选结果或搜索描述
SCRIPT
模板通常会创建:
成功部署返回:
{
"data": {
"templateDeployV2": {
"projectId": "proj-123",
"workflowId": "deployTemplate/project/proj-123/xxx"
}
}
}
| 错误 | 原因 | 解决方案 |
|---|---|---|
| 模板未找到 | 代码无效 | 搜索模板或检查拼写 |
| 超出速率限制 | 搜索过于频繁 | 等待 1 分钟,然后重试 |
| 权限被拒绝 | 用户缺少访问权限 | 需要 DEVELOPER 角色或更高级别 |
| 项目未找到 | 项目 ID 无效 | 运行 railway status --json |
environment 技能添加变量引用service 技能deployment 技能domain 技能每周安装量
716
仓库
GitHub 星标数
213
首次出现
2026年1月20日
安全审计
安装于
opencode604
codex595
gemini-cli569
github-copilot540
claude-code536
amp493
Search and deploy services from Railway's template marketplace.
| Category | Template | Code |
|---|---|---|
| Databases | PostgreSQL | postgres |
| Redis | redis | |
| MySQL | mysql | |
| MongoDB | mongodb | |
| CMS | Ghost | ghost |
| Strapi | strapi | |
| Storage | Minio | minio |
| Automation | n8n | n8n |
| Monitoring | Uptime Kuma | uptime-kuma |
For other templates, use the search query below.
Get project context:
railway status --json
Extract:
id - project IDenvironments.edges[0].node.id - environment IDGet workspace ID:
bash <<'SCRIPT'
scripts/railway-api.sh \
'query getWorkspace($projectId: String!) {
project(id: $projectId) { workspaceId }
}' \
'{"projectId": "PROJECT_ID"}'
SCRIPT
List available templates with optional filters:
bash <<'SCRIPT'
scripts/railway-api.sh \
'query templates($first: Int, $verified: Boolean) {
templates(first: $first, verified: $verified) {
edges {
node {
name
code
description
category
}
}
}
}' \
'{"first": 20, "verified": true}'
SCRIPT
| Argument | Type | Description |
|---|---|---|
first | Int | Number of results (max ~100) |
verified | Boolean | Only verified templates |
recommended | Boolean | Only recommended templates |
10 requests per minute. Don't spam searches.
Fetch a specific template by code:
bash <<'SCRIPT'
scripts/railway-api.sh \
'query template($code: String!) {
template(code: $code) {
id
name
description
serializedConfig
}
}' \
'{"code": "postgres"}'
SCRIPT
Returns:
id - template ID (needed for deployment)serializedConfig - service configuration (needed for deployment)bash <<'SCRIPT'
scripts/railway-api.sh \
'query template($code: String!) {
template(code: $code) {
id
serializedConfig
}
}' \
'{"code": "postgres"}'
SCRIPT
bash <<'SCRIPT'
scripts/railway-api.sh \
'mutation deployTemplate($input: TemplateDeployV2Input!) {
templateDeployV2(input: $input) {
projectId
workflowId
}
}' \
'{
"input": {
"templateId": "TEMPLATE_ID_FROM_STEP_1",
"serializedConfig": SERIALIZED_CONFIG_FROM_STEP_1,
"projectId": "PROJECT_ID",
"environmentId": "ENVIRONMENT_ID",
"workspaceId": "WORKSPACE_ID"
}
}'
SCRIPT
Important: serializedConfig is the exact JSON object from the template query, not a string.
After deploying a template, connect other services using reference variables.
For complete variable syntax and wiring patterns, see variables.md.
${{ServiceName.VARIABLE_NAME}}
| Service | Connection Variable |
|---|---|
| PostgreSQL (Postgres) | ${{Postgres.DATABASE_URL}} |
| Redis | ${{Redis.REDIS_URL}} |
| MySQL | ${{MySQL.MYSQL_URL}} |
| MongoDB | ${{MongoDB.MONGO_URL}} |
Backend services can use private URLs (internal network):
${{Postgres.DATABASE_URL}}
Frontend applications run in the browser and cannot access Railway's private network. Options:
${{MongoDB.MONGO_PUBLIC_URL}})bash <<'SCRIPT'
# 1. Get context
railway status --json
# → project.id = "proj-123", environment.id = "env-456"
# 2. Get workspace ID
scripts/railway-api.sh \
'query { project(id: "proj-123") { workspaceId } }' '{}'
# → workspaceId = "ws-789"
# 3. Fetch Postgres template
scripts/railway-api.sh \
'query { template(code: "postgres") { id serializedConfig } }' '{}'
# → id = "template-abc", serializedConfig = {...}
# 4. Deploy
scripts/railway-api.sh \
'mutation deploy($input: TemplateDeployV2Input!) {
templateDeployV2(input: $input) { projectId workflowId }
}' \
'{"input": {
"templateId": "template-abc",
"serializedConfig": {...},
"projectId": "proj-123",
"environmentId": "env-456",
"workspaceId": "ws-789"
}}'
SCRIPT
bash <<'SCRIPT'
# Search verified templates
scripts/railway-api.sh \
'query {
templates(first: 50, verified: true) {
edges {
node { name code description category }
}
}
}' '{}'
# Filter results for "CMS" category or search descriptions
SCRIPT
Templates typically create:
Successful deployment returns:
{
"data": {
"templateDeployV2": {
"projectId": "proj-123",
"workflowId": "deployTemplate/project/proj-123/xxx"
}
}
}
| Error | Cause | Solution |
|---|---|---|
| Template not found | Invalid code | Search templates or check spelling |
| Rate limit exceeded | Too many searches | Wait 1 minute, then retry |
| Permission denied | User lacks access | Need DEVELOPER role or higher |
| Project not found | Invalid project ID | Run railway status --json |
environment skill to add variable referencesservice skilldeployment skilldomain skillWeekly Installs
716
Repository
GitHub Stars
213
First Seen
Jan 20, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode604
codex595
gemini-cli569
github-copilot540
claude-code536
amp493