{
  "manifest_version": "1.0.0",
  "template": {
    "id": "956a24de-a9d0-4b8e-9b98-51ff7b3f7d81",
    "slug": "deploy-immich-with-database-backups",
    "name": "Immich Backups",
    "description": "Automatic Immich database dumps and a restore plan",
    "url": "https://railway.com/deploy/deploy-immich-with-database-backups",
    "upstream": {
      "image": "ghcr.io/immich-app/immich-server:v3.3.3@sha256:bae7664ff3aa4c2c1fcbdcdd86b40b105643c5f861f3e6a770fc760089f25862"
    }
  },
  "services": [
    {
      "name": "immich-machine-learning",
      "source": {
        "image": "ghcr.io/immich-app/immich-machine-learning:v3.3.3@sha256:73915f07e1f4289ba45b174c58443db74cef47ddf502613f475fc5e52458ea42"
      },
      "needs_volume": true,
      "volume_mount_path": "/cache",
      "http": false
    },
    {
      "name": "immich-server",
      "source": {
        "image": "ghcr.io/immich-app/immich-server:v3.3.3@sha256:bae7664ff3aa4c2c1fcbdcdd86b40b105643c5f861f3e6a770fc760089f25862"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Valkey",
      "source": {
        "image": "valkey/valkey:9.1.2@sha256:c123e3715db63d06d4ad6964884037aa0d5d4d703939b9929954112889708e1d"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "immich-machine-learning",
      "description": "Port Railway healthchecks the ML service on; keep 3003",
      "secret": false,
      "strategy": "default",
      "default": "3003"
    },
    {
      "key": "IMMICH_HOST",
      "service": "immich-machine-learning",
      "description": "Bind address; [::] listens dual-stack on Railway's private network",
      "secret": false,
      "strategy": "default",
      "default": "[::]"
    },
    {
      "key": "IMMICH_PORT",
      "service": "immich-machine-learning",
      "description": "Port the ML server listens on; must match PORT",
      "secret": false,
      "strategy": "default",
      "default": "3003"
    },
    {
      "key": "MACHINE_LEARNING_WORKERS",
      "service": "immich-machine-learning",
      "description": "Number of inference worker processes; each loads its own models",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "MACHINE_LEARNING_MODEL_TTL",
      "service": "immich-machine-learning",
      "description": "Seconds an idle model stays in RAM before it is unloaded",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "MACHINE_LEARNING_CACHE_FOLDER",
      "service": "immich-machine-learning",
      "description": "Model download cache, on the /cache volume so models survive redeploys",
      "secret": false,
      "strategy": "default",
      "default": "/cache"
    },
    {
      "key": "TZ",
      "service": "immich-server",
      "description": "Server timezone used for dates and scheduled jobs; set to your own if you like",
      "secret": false,
      "strategy": "default",
      "default": "Etc/UTC"
    },
    {
      "key": "PORT",
      "service": "immich-server",
      "description": "Port Railway routes the public domain and healthcheck to; keep 2283",
      "secret": false,
      "strategy": "default",
      "default": "2283"
    },
    {
      "key": "DB_PORT",
      "service": "immich-server",
      "description": "Postgres port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "REDIS_PORT",
      "service": "immich-server",
      "description": "Valkey port",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "DB_HOSTNAME",
      "service": "immich-server",
      "description": "Private hostname of the VectorChord Postgres service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DB_PASSWORD",
      "service": "immich-server",
      "description": "Database password, referenced from Postgres (alphanumeric)",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_USERNAME",
      "service": "immich-server",
      "description": "Database user, referenced from Postgres",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "IMMICH_PORT",
      "service": "immich-server",
      "description": "Port the Immich server listens on; must match PORT",
      "secret": false,
      "strategy": "default",
      "default": "2283"
    },
    {
      "key": "REDIS_HOSTNAME",
      "service": "immich-server",
      "description": "Private hostname of the Valkey job-queue service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "immich-server",
      "description": "Valkey password, referenced from Valkey",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_DATABASE_NAME",
      "service": "immich-server",
      "description": "Database name, referenced from Postgres",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "IMMICH_MACHINE_LEARNING_URL",
      "service": "immich-server",
      "description": "Private URL of the machine-learning service for smart search, faces and OCR",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data directory, a subfolder of the volume so initdb avoids lost+found",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private hostname of the database",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Postgres port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Postgres user for psql and other clients",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Default database for psql and other clients",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Postgres password for psql and other clients",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database Immich uses",
      "secret": false,
      "strategy": "default",
      "default": "immich"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Full private Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Postgres superuser name",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "DB_STORAGE_TYPE",
      "service": "Postgres",
      "description": "Tells Immich's Postgres image to tune for SSD storage",
      "secret": false,
      "strategy": "default",
      "default": "SSD"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated alphanumeric Postgres password (Immich requires A-Z, a-z, 0-9)",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "POSTGRES_INITDB_ARGS",
      "service": "Postgres",
      "description": "Extra initdb flags on first boot; enables data checksums as upstream does",
      "secret": false,
      "strategy": "default",
      "default": "--data-checksums"
    },
    {
      "key": "REDISHOST",
      "service": "Valkey",
      "description": "Private hostname of Valkey",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Valkey",
      "description": "Valkey port",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Valkey",
      "description": "Valkey user name",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Valkey",
      "description": "Full private Valkey connection URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Valkey",
      "description": "Valkey password for clients",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Valkey",
      "description": "Generated alphanumeric Valkey password, passed to --requirepass",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "deploy-immich-with-database-backups"
      }
    },
    "cli": "railway deploy --template deploy-immich-with-database-backups",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "956a24de-a9d0-4b8e-9b98-51ff7b3f7d81",
            "serializedConfig": {
              "services": {
                "2ca6a605-a5be-4d93-8de8-ef56a682f637": {
                  "icon": null,
                  "name": "immich-machine-learning",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/ping",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/immich-app/immich-machine-learning:v3.3.3@sha256:73915f07e1f4289ba45b174c58443db74cef47ddf502613f475fc5e52458ea42"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway healthchecks the ML service on; keep 3003",
                      "defaultValue": "3003"
                    },
                    "IMMICH_HOST": {
                      "isOptional": false,
                      "description": "Bind address; [::] listens dual-stack on Railway's private network",
                      "defaultValue": "[::]"
                    },
                    "IMMICH_PORT": {
                      "isOptional": false,
                      "description": "Port the ML server listens on; must match PORT",
                      "defaultValue": "3003"
                    },
                    "MACHINE_LEARNING_WORKERS": {
                      "isOptional": false,
                      "description": "Number of inference worker processes; each loads its own models",
                      "defaultValue": "1"
                    },
                    "MACHINE_LEARNING_MODEL_TTL": {
                      "isOptional": false,
                      "description": "Seconds an idle model stays in RAM before it is unloaded",
                      "defaultValue": "300"
                    },
                    "MACHINE_LEARNING_CACHE_FOLDER": {
                      "isOptional": false,
                      "description": "Model download cache, on the /cache volume so models survive redeploys",
                      "defaultValue": "/cache"
                    }
                  },
                  "volumeMounts": {
                    "2ca6a605-a5be-4d93-8de8-ef56a682f637": {
                      "mountPath": "/cache"
                    }
                  }
                },
                "6325d7ad-712e-4245-a638-d915ec19d725": {
                  "icon": null,
                  "name": "immich-server",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/server/ping",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/immich-app/immich-server:v3.3.3@sha256:bae7664ff3aa4c2c1fcbdcdd86b40b105643c5f861f3e6a770fc760089f25862"
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "Server timezone used for dates and scheduled jobs; set to your own if you like",
                      "defaultValue": "Etc/UTC"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway routes the public domain and healthcheck to; keep 2283",
                      "defaultValue": "2283"
                    },
                    "DB_PORT": {
                      "isOptional": false,
                      "description": "Postgres port",
                      "defaultValue": "5432"
                    },
                    "REDIS_PORT": {
                      "isOptional": false,
                      "description": "Valkey port",
                      "defaultValue": "6379"
                    },
                    "DB_HOSTNAME": {
                      "isOptional": false,
                      "description": "Private hostname of the VectorChord Postgres service",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DB_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password, referenced from Postgres (alphanumeric)",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "DB_USERNAME": {
                      "isOptional": false,
                      "description": "Database user, referenced from Postgres",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "IMMICH_PORT": {
                      "isOptional": false,
                      "description": "Port the Immich server listens on; must match PORT",
                      "defaultValue": "2283"
                    },
                    "REDIS_HOSTNAME": {
                      "isOptional": false,
                      "description": "Private hostname of the Valkey job-queue service",
                      "defaultValue": "${{Valkey.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Valkey password, referenced from Valkey",
                      "defaultValue": "${{Valkey.REDIS_PASSWORD}}"
                    },
                    "DB_DATABASE_NAME": {
                      "isOptional": false,
                      "description": "Database name, referenced from Postgres",
                      "defaultValue": "${{Postgres.POSTGRES_DB}}"
                    },
                    "IMMICH_MACHINE_LEARNING_URL": {
                      "isOptional": false,
                      "description": "Private URL of the machine-learning service for smart search, faces and OCR",
                      "defaultValue": "http://${{immich-machine-learning.RAILWAY_PRIVATE_DOMAIN}}:3003"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:2283": {
                        "port": 2283
                      }
                    }
                  },
                  "volumeMounts": {
                    "6325d7ad-712e-4245-a638-d915ec19d725": {
                      "mountPath": "/data"
                    }
                  }
                },
                "6bc3b129-5e4b-423d-860e-c3b354eb0936": {
                  "icon": null,
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0@sha256:bcf63357191b76a916ae5eb93464d65c07511da41e3bf7a8416db519b40b1c23"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory, a subfolder of the volume so initdb avoids lost+found",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private hostname of the database",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Postgres port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Postgres user for psql and other clients",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Default database for psql and other clients",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password for psql and other clients",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database Immich uses",
                      "defaultValue": "immich"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Full private Postgres connection string",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres superuser name",
                      "defaultValue": "postgres"
                    },
                    "DB_STORAGE_TYPE": {
                      "isOptional": false,
                      "description": "Tells Immich's Postgres image to tune for SSD storage",
                      "defaultValue": "SSD"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated alphanumeric Postgres password (Immich requires A-Z, a-z, 0-9)",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_INITDB_ARGS": {
                      "isOptional": false,
                      "description": "Extra initdb flags on first boot; enables data checksums as upstream does",
                      "defaultValue": "--data-checksums"
                    }
                  },
                  "volumeMounts": {
                    "6bc3b129-5e4b-423d-860e-c3b354eb0936": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "96774b43-d5f9-459e-beec-400fc733dfd3": {
                  "icon": null,
                  "name": "Valkey",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf /data/lost+found && exec docker-entrypoint.sh valkey-server --requirepass $REDIS_PASSWORD --save 60 1 --dir /data --maxmemory-policy noeviction --bind '* -::*'\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "valkey/valkey:9.1.2@sha256:c123e3715db63d06d4ad6964884037aa0d5d4d703939b9929954112889708e1d"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Private hostname of Valkey",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Valkey port",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Valkey user name",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Full private Valkey connection URL",
                      "defaultValue": "redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Valkey password for clients",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated alphanumeric Valkey password, passed to --requirepass",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "96774b43-d5f9-459e-beec-400fc733dfd3": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "immich-server",
      "method": "GET",
      "path": "/api/server/ping",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-10-21T10:14:45.258Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-10-21T07:04:56.367Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_e8aa9fa89ac04f7a8050",
    "checks": [
      {
        "name": "run_completed",
        "passed": false,
        "detail": "Railway API errors: Not Authorized"
      },
      {
        "name": "cleanup",
        "passed": false,
        "detail": "Railway API errors: Not Authorized"
      }
    ]
  }
}
