{
  "manifest_version": "1.0.0",
  "template": {
    "id": "d0016ba2-0067-4979-ace6-3eac6b253190",
    "slug": "nextcloud-self-hosted-google-drive-alter",
    "name": "Nextcloud (Self-Hosted Google Drive Alternative)",
    "description": "Self-hosted Google Drive/Dropbox alternative — files, calendar & contacts",
    "url": "https://railway.com/deploy/nextcloud-self-hosted-google-drive-alter",
    "upstream": {
      "image": "nextcloud:31-apache"
    }
  },
  "services": [
    {
      "name": "nextcloud",
      "source": {
        "image": "nextcloud:31-apache"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/www/html",
      "http": true
    },
    {
      "name": "redis",
      "source": {
        "image": "redis:7-alpine"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "postgres",
      "source": {
        "image": "postgres:16"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "REDIS_HOST",
      "service": "nextcloud",
      "description": "Redis host for file locking and caching. References the redis service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_DB",
      "service": "nextcloud",
      "description": "Database name Nextcloud uses. Matches the postgres service.",
      "secret": false,
      "strategy": "default",
      "default": "nextcloud"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "nextcloud",
      "description": "Postgres host over Railway's private network. References the postgres service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "nextcloud",
      "description": "Database user. Matches the postgres service.",
      "secret": false,
      "strategy": "default",
      "default": "nextcloud"
    },
    {
      "key": "OVERWRITECLIURL",
      "service": "nextcloud",
      "description": "Base URL used for CLI and cron. Auto-filled from the generated domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "REDIS_HOST_PORT",
      "service": "nextcloud",
      "description": "Redis port. Leave as the default.",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "OVERWRITEPROTOCOL",
      "service": "nextcloud",
      "description": "Forces Nextcloud to generate https URLs behind Railway's TLS proxy. Leave as https.",
      "secret": false,
      "strategy": "default",
      "default": "https"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "nextcloud",
      "description": "Database password. References the postgres service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTCLOUD_ADMIN_USER",
      "service": "nextcloud",
      "description": "Username of the admin account created on first boot. Change if you like.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "NEXTCLOUD_ADMIN_PASSWORD",
      "service": "nextcloud",
      "description": "Auto-generated admin password. Copy it from here to log in the first time.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NEXTCLOUD_TRUSTED_DOMAINS",
      "service": "nextcloud",
      "description": "Domains allowed to serve Nextcloud. Auto-filled from the generated Railway domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PGDATA",
      "service": "postgres",
      "description": "Postgres data directory on the mounted volume. The /pgdata subdirectory avoids the lost+found init error.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres",
      "description": "Database Nextcloud uses. Referenced by the nextcloud service.",
      "secret": false,
      "strategy": "default",
      "default": "nextcloud"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres",
      "description": "Database user Nextcloud connects as. Referenced by the nextcloud service.",
      "secret": false,
      "strategy": "default",
      "default": "nextcloud"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Auto-generated database password. Alphanumeric to stay safe inside connection strings.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "nextcloud-self-hosted-google-drive-alter"
      }
    },
    "cli": "railway deploy --template nextcloud-self-hosted-google-drive-alter",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "d0016ba2-0067-4979-ace6-3eac6b253190",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "051283c6-a028-495b-8a2c-213c7641f959": {
                  "icon": null,
                  "name": "nextcloud",
                  "deploy": {
                    "startCommand": "bash -c \"a2dismod mpm_event mpm_worker >/dev/null 2>&1; a2enmod mpm_prefork >/dev/null 2>&1; apache2-foreground\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "nextcloud:31-apache"
                  },
                  "variables": {
                    "REDIS_HOST": {
                      "isOptional": false,
                      "description": "Redis host for file locking and caching. References the redis service.",
                      "defaultValue": "${{redis.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name Nextcloud uses. Matches the postgres service.",
                      "defaultValue": "nextcloud"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Postgres host over Railway's private network. References the postgres service.",
                      "defaultValue": "${{postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user. Matches the postgres service.",
                      "defaultValue": "nextcloud"
                    },
                    "OVERWRITECLIURL": {
                      "isOptional": false,
                      "description": "Base URL used for CLI and cron. Auto-filled from the generated domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "REDIS_HOST_PORT": {
                      "isOptional": false,
                      "description": "Redis port. Leave as the default.",
                      "defaultValue": "6379"
                    },
                    "OVERWRITEPROTOCOL": {
                      "isOptional": false,
                      "description": "Forces Nextcloud to generate https URLs behind Railway's TLS proxy. Leave as https.",
                      "defaultValue": "https"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password. References the postgres service.",
                      "defaultValue": "${{postgres.POSTGRES_PASSWORD}}"
                    },
                    "NEXTCLOUD_ADMIN_USER": {
                      "isOptional": false,
                      "description": "Username of the admin account created on first boot. Change if you like.",
                      "defaultValue": "admin"
                    },
                    "NEXTCLOUD_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated admin password. Copy it from here to log in the first time.",
                      "defaultValue": "{{NEXTCLOUD_ADMIN_PASSWORD}}"
                    },
                    "NEXTCLOUD_TRUSTED_DOMAINS": {
                      "isOptional": false,
                      "description": "Domains allowed to serve Nextcloud. Auto-filled from the generated Railway domain.",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:80": {
                        "port": 80
                      }
                    }
                  },
                  "volumeMounts": {
                    "051283c6-a028-495b-8a2c-213c7641f959": {
                      "mountPath": "/var/www/html"
                    }
                  }
                },
                "5e02213f-57ac-4c88-b571-b3f5bd138d4e": {
                  "icon": null,
                  "name": "redis",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:7-alpine"
                  },
                  "variables": {}
                },
                "f1132575-5705-4832-a693-c4c2cfe6c922": {
                  "icon": null,
                  "name": "postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:16"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Postgres data directory on the mounted volume. The /pgdata subdirectory avoids the lost+found init error.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database Nextcloud uses. Referenced by the nextcloud service.",
                      "defaultValue": "nextcloud"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user Nextcloud connects as. Referenced by the nextcloud service.",
                      "defaultValue": "nextcloud"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password. Alphanumeric to stay safe inside connection strings.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "f1132575-5705-4832-a693-c4c2cfe6c922": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-09T06:02:34.665Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-04T06:47:57.994Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_17348bb531394867aa4b",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 27,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "nextcloud"
  }
}
