{
  "manifest_version": "1.0.0",
  "template": {
    "id": "8b593ec2-da98-4f02-bdbc-e7cf37b575c5",
    "slug": "nextcloud",
    "name": "Nextcloud",
    "description": "Deploy Nextcloud with Bucket storage for scalable cloud file hosting",
    "url": "https://railway.com/deploy/nextcloud",
    "upstream": {
      "image": "nextcloud"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Nextcloud",
      "source": {
        "image": "nextcloud"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/www/html",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "POSTGRES_DB",
      "service": "Nextcloud",
      "description": "Name of the PostgreSQL database used by Nextcloud",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "OVERWRITEHOST",
      "service": "Nextcloud",
      "description": "Forces Nextcloud to generate URLs using this hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "POSTGRES_HOST",
      "service": "Nextcloud",
      "description": "Hostname of the PostgreSQL database server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Nextcloud",
      "description": "Username for the PostgreSQL database connection",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTCLOUD_UPDATE",
      "service": "Nextcloud",
      "description": "Enable install/update logic when using a custom command",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "OVERWRITEPROTOCOL",
      "service": "Nextcloud",
      "description": "Forces Nextcloud to use HTTPS behind a reverse proxy",
      "secret": false,
      "strategy": "default",
      "default": "https"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Nextcloud",
      "description": "Password for the PostgreSQL database user",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "OBJECTSTORE_S3_KEY",
      "service": "Nextcloud",
      "description": "Access key ID for S3 authentication",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "OBJECTSTORE_S3_SSL",
      "service": "Nextcloud",
      "description": "Enable SSL/TLS when connecting to the S3 endpoint",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "OBJECTSTORE_S3_HOST",
      "service": "Nextcloud",
      "description": "S3-compatible endpoint hostname",
      "secret": false,
      "strategy": "default",
      "default": "storage.railway.app"
    },
    {
      "key": "OBJECTSTORE_S3_PORT",
      "service": "Nextcloud",
      "description": "Network port used to connect to the S3 endpoint",
      "secret": false,
      "strategy": "default",
      "default": "443"
    },
    {
      "key": "NEXTCLOUD_ADMIN_USER",
      "service": "Nextcloud",
      "description": "Username for the initial Nextcloud admin account",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "OBJECTSTORE_S3_BUCKET",
      "service": "Nextcloud",
      "description": "S3 bucket name used as Nextcloud primary storage",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "OBJECTSTORE_S3_REGION",
      "service": "Nextcloud",
      "description": "S3 region where the bucket is hosted",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "OBJECTSTORE_S3_SECRET",
      "service": "Nextcloud",
      "description": "Secret access key for S3 authentication",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTCLOUD_ADMIN_PASSWORD",
      "service": "Nextcloud",
      "description": "Password for the initial Nextcloud admin account",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NEXTCLOUD_TRUSTED_DOMAINS",
      "service": "Nextcloud",
      "description": "Domains allowed to access Nextcloud (prevents host header attacks)",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Provide a value for PGDATA.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Provide a value for PGHOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Provide a value for PGPORT.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Provide a value for PGUSER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Provide a value for PGDATABASE.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Provide a value for PGPASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Provide a value for DATABASE_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Provide a value for SSL_CERT_DAYS.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Provide a value for DATABASE_PUBLIC_URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Provide a value for RAILWAY_DEPLOYMENT_DRAINING_SECONDS.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "nextcloud"
      }
    },
    "cli": "railway deploy --template nextcloud",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "8b593ec2-da98-4f02-bdbc-e7cf37b575c5",
            "serializedConfig": {
              "buckets": {
                "4b80ba67-3b7d-43e2-b3f4-36dbe2eaa891": {
                  "name": "Storage"
                }
              },
              "services": {
                "dfd9f6c8-6d98-4f4c-905d-f2947d5044c8": {
                  "icon": null,
                  "name": "Nextcloud",
                  "deploy": {
                    "startCommand": "sh -lc 'set -e; P=\"${PORT:-8080}\"; a2dismod mpm_event mpm_worker >/dev/null 2>&1 || true; a2enmod mpm_prefork >/dev/null 2>&1 || true; echo \"ServerName localhost\" > /etc/apache2/conf-available/servername.conf; a2enconf servername >/dev/null 2>&1 || true; sed -i \"s/^Listen 80$/Listen ${P}/\" /etc/apache2/ports.conf; sed -i \"s/<VirtualHost \\*:80>/<VirtualHost *:${P}>/\" /etc/apache2/sites-available/000-default.conf; exec /entrypoint.sh apache2-foreground'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "nextcloud"
                  },
                  "variables": {
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Name of the PostgreSQL database used by Nextcloud",
                      "defaultValue": "${{Postgres.POSTGRES_DB}}"
                    },
                    "OVERWRITEHOST": {
                      "isOptional": false,
                      "description": "Forces Nextcloud to generate URLs using this hostname",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "POSTGRES_HOST": {
                      "isOptional": false,
                      "description": "Hostname of the PostgreSQL database server",
                      "defaultValue": "${{Postgres.PGHOST}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Username for the PostgreSQL database connection",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "NEXTCLOUD_UPDATE": {
                      "description": "Enable install/update logic when using a custom command",
                      "defaultValue": "1"
                    },
                    "OVERWRITEPROTOCOL": {
                      "isOptional": false,
                      "description": "Forces Nextcloud to use HTTPS behind a reverse proxy",
                      "defaultValue": "https"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the PostgreSQL database user",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "OBJECTSTORE_S3_KEY": {
                      "isOptional": false,
                      "description": "Access key ID for S3 authentication",
                      "defaultValue": "${{Storage.ACCESS_KEY_ID}}"
                    },
                    "OBJECTSTORE_S3_SSL": {
                      "isOptional": false,
                      "description": "Enable SSL/TLS when connecting to the S3 endpoint",
                      "defaultValue": "true"
                    },
                    "OBJECTSTORE_S3_HOST": {
                      "isOptional": false,
                      "description": "S3-compatible endpoint hostname",
                      "defaultValue": "storage.railway.app"
                    },
                    "OBJECTSTORE_S3_PORT": {
                      "isOptional": false,
                      "description": "Network port used to connect to the S3 endpoint",
                      "defaultValue": "443"
                    },
                    "NEXTCLOUD_ADMIN_USER": {
                      "isOptional": false,
                      "description": "Username for the initial Nextcloud admin account",
                      "defaultValue": "{{NEXTCLOUD_ADMIN_USER}}"
                    },
                    "OBJECTSTORE_S3_BUCKET": {
                      "isOptional": false,
                      "description": "S3 bucket name used as Nextcloud primary storage",
                      "defaultValue": "${{Storage.BUCKET}}"
                    },
                    "OBJECTSTORE_S3_REGION": {
                      "isOptional": false,
                      "description": "S3 region where the bucket is hosted",
                      "defaultValue": "${{Storage.REGION}}"
                    },
                    "OBJECTSTORE_S3_SECRET": {
                      "isOptional": false,
                      "description": "Secret access key for S3 authentication",
                      "defaultValue": "${{Storage.SECRET_ACCESS_KEY}}"
                    },
                    "NEXTCLOUD_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the initial Nextcloud admin account",
                      "defaultValue": "{{NEXTCLOUD_ADMIN_PASSWORD}}"
                    },
                    "NEXTCLOUD_TRUSTED_DOMAINS": {
                      "isOptional": false,
                      "description": "Domains allowed to access Nextcloud (prevents host header attacks)",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "dfd9f6c8-6d98-4f4c-905d-f2947d5044c8": {
                      "mountPath": "/var/www/html"
                    }
                  }
                },
                "f4c09df6-1bf5-4478-97fe-3d4bb0750ff4": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "f4c09df6-1bf5-4478-97fe-3d4bb0750ff4": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-07T23:54:17.958Z",
  "generator_version": "0.1.0"
}
