{
  "manifest_version": "1.0.0",
  "template": {
    "id": "d059d5fe-1a85-4759-94b3-f8e747366b7e",
    "slug": "crm",
    "name": "CRM | EspoCRM, Open-Source Salesforce Alternative",
    "description": "EspoCRM 10 on Postgres with live updates and an admin ready on boot",
    "url": "https://railway.com/deploy/crm",
    "upstream": {
      "repo_url": "https://github.com/nomideusz/espocrm-railway"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "EspoCRM",
      "source": {
        "repo": "https://github.com/nomideusz/espocrm-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/www/html/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "espocrm"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database user",
      "secret": false,
      "strategy": "default",
      "default": "espocrm"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Time for Postgres to shut down cleanly on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "EspoCRM",
      "description": "Port Apache listens on - leave as is",
      "secret": false,
      "strategy": "default",
      "default": "80"
    },
    {
      "key": "ESPOCRM_SITE_URL",
      "service": "EspoCRM",
      "description": "Address used in links, emails and the live-update connection - set it to your custom domain when you add one",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "ESPOCRM_DATABASE_HOST",
      "service": "EspoCRM",
      "description": "Postgres host - private network, leave as is",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "ESPOCRM_DATABASE_NAME",
      "service": "EspoCRM",
      "description": "Postgres database - leave as is",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ESPOCRM_DATABASE_PORT",
      "service": "EspoCRM",
      "description": "Postgres port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "ESPOCRM_DATABASE_USER",
      "service": "EspoCRM",
      "description": "Postgres user - leave as is",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ESPOCRM_ADMIN_PASSWORD",
      "service": "EspoCRM",
      "description": "Password for the admin login, set on first boot only - copy it from here to log in, then change it in EspoCRM",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "ESPOCRM_DATABASE_PASSWORD",
      "service": "EspoCRM",
      "description": "Postgres password - leave as is",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ESPOCRM_DATABASE_PLATFORM",
      "service": "EspoCRM",
      "description": "Database type - leave as is",
      "secret": false,
      "strategy": "default",
      "default": "Postgresql"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "crm"
      }
    },
    "cli": "railway deploy --template crm",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "d059d5fe-1a85-4759-94b3-f8e747366b7e",
            "serializedConfig": {
              "services": {
                "2865a2fa-e183-4c89-86ec-a92aec2bf8e2": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "espocrm"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "espocrm"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time for Postgres to shut down cleanly on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "2865a2fa-e183-4c89-86ec-a92aec2bf8e2": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "29d64360-a372-405e-9fce-ae46c9862afd": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/espocrm.svg",
                  "name": "EspoCRM",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/espocrm-railway",
                    "rootDirectory": "/espocrm"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Apache listens on - leave as is",
                      "defaultValue": "80"
                    },
                    "ESPOCRM_SITE_URL": {
                      "isOptional": false,
                      "description": "Address used in links, emails and the live-update connection - set it to your custom domain when you add one",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "ESPOCRM_DATABASE_HOST": {
                      "isOptional": false,
                      "description": "Postgres host - private network, leave as is",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "ESPOCRM_DATABASE_NAME": {
                      "isOptional": false,
                      "description": "Postgres database - leave as is",
                      "defaultValue": "${{Postgres.POSTGRES_DB}}"
                    },
                    "ESPOCRM_DATABASE_PORT": {
                      "isOptional": false,
                      "description": "Postgres port",
                      "defaultValue": "5432"
                    },
                    "ESPOCRM_DATABASE_USER": {
                      "isOptional": false,
                      "description": "Postgres user - leave as is",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "ESPOCRM_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the admin login, set on first boot only - copy it from here to log in, then change it in EspoCRM",
                      "defaultValue": "{{ESPOCRM_ADMIN_PASSWORD}}"
                    },
                    "ESPOCRM_DATABASE_PASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password - leave as is",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "ESPOCRM_DATABASE_PLATFORM": {
                      "isOptional": false,
                      "description": "Database type - leave as is",
                      "defaultValue": "Postgresql"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "29d64360-a372-405e-9fce-ae46c9862afd": {
                      "mountPath": "/var/www/html/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "EspoCRM",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-27T22:14:44.387Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-27T21:42:39.674Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_fef5c6d34d5a4a6d8cd7",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 58,
    "typical_build_seconds": 31,
    "typical_start_seconds": 10,
    "slowest_service": "EspoCRM"
  }
}
