Skip to content

Prelaunch & Uplinks

Mothership fails fast: before a single ship launches, it verifies that external dependencies are reachable (uplinks) and runs your setup tasks (prelaunch jobs). If either fails, the launch aborts.

  1. Uplinks are verified (if configured)
  2. Prelaunch jobs run in dependency order
  3. Ships and bays launch

Uplinks are pre-flight connectivity checks for databases, caches, and services your fleet depends on:

[[mothership.uplinks]]
url = "postgres://localhost:5432/mydb"
name = "postgres"
[[mothership.uplinks]]
url = "$DATABASE_URL" # env var expansion
name = "primary-db"
timeout = "10s" # default: 5s
[[mothership.uplinks]]
url = "redis://cache.internal:6379"
name = "redis"
Scheme Default port Check
postgres://, postgresql:// 5432 TCP
mysql:// 3306 TCP
redis:// 6379 TCP
memgraph://, neo4j:// 7687 TCP
http://, https:// 80/443 HTTP GET
tcp:// required TCP

Uplinks sharing the same host:port are checked only once:

# These share the same server — only one TCP check happens
[[mothership.uplinks]]
url = "postgres://localhost:5432/app_production"
name = "primary"
[[mothership.uplinks]]
url = "postgres://localhost:5432/app_replica"
name = "replica"
Terminal window
mothership preflight # validate manifest + verify uplinks (needs network access)
mothership clearance # offline manifest validation only

preflight requires network access to the configured uplinks — running it on your laptop may fail if the uplinks are only reachable from the deployment environment.

Prelaunch jobs run setup tasks — migrations, cache warmup, schema initialization — before any ship or bay starts. All jobs must complete successfully or the launch is aborted.

[[mothership.prelaunch]]
name = "ar-migrate"
command = "rails"
args = ["db:migrate"]
[[mothership.prelaunch]]
name = "memgraph-migrate"
command = "./migrate-memgraph"
depends_on = ["ar-migrate"] # runs after ar-migrate completes
Field Type Default Description
name string required Unique identifier
command string required Command to execute
args string[] [] Command arguments
env table {} Environment variables
depends_on string[] [] Other prelaunch jobs to wait for

If any prelaunch job exits non-zero, the entire launch is aborted.

Deploying the same manifest across multiple servers? Use Flagship so migrations run on exactly one instance.