The scripts in deploy/ determine local versus VPS mode from BASE_HOST in the repository .env. Empty or localhost[:port] means local; any other value means VPS. Their shared behavior is implemented in deploy/lib.sh.
For installation and normal platform redeployment, use ./setup.sh. Use these helpers for targeted operations and maintenance.
Command summary
| Script | Flags or arguments | What it actually does |
|---|---|---|
deploy/start.sh | --build, --seed, -h/--help | Starts Traefik first in VPS mode, then starts the selected stack; optionally builds and seeds. |
deploy/stop.sh | --with-proxy, -h/--help | Stops every VPS project, then the Console; optionally stops production Traefik. Local mode stops the root Compose stack. |
deploy/restart.sh | --build, --seed, -h/--help | Runs stop.sh, then forwards the selected flags to start.sh. |
deploy/status.sh | none | Runs docker compose ps for the selected stack. |
deploy/logs.sh | optional service, then Compose log options | Follows Console logs in VPS mode or API logs locally unless a service is supplied. |
deploy/reset.sh | --yes/-y, --keep-images, -h/--help | Destructively removes project, Console, Traefik, and legacy stack state, then removes generated environment files. It does not restart. |
deploy/docker-cleanup.sh | none | Sourced function library for removing Compose containers and volumes by Docker labels or volume attachment. |
deploy/new-project.sh | none | Prints a deprecation error and exits with status 1. Projects must be created from the Console. |
deploy/build-images.sh | none | Builds dependency, API, Console, orchestrator, and PostgreSQL images in sequence. |
deploy/dev-up.sh | none | Starts dev Traefik, then runs the Console on the host with CONSOLE_MODE=dev npm run console:dev. |
Unknown options cause start.sh, stop.sh, restart.sh, and reset.sh to exit with an error.
Start
./deploy/start.sh
./deploy/start.sh --build
./deploy/start.sh --seed
./deploy/start.sh --build --seedIn local mode, deploy/lib.sh selects the root docker-compose.yml. In VPS mode it selects deploy/console/docker-compose.yml with deploy/console/.env, and start_proxy_if_needed starts deploy/traefik/docker-compose.yml first.
--build adds --build to Compose up -d. --seed repeatedly runs node apps/server/dist/prisma/seed.js inside the local API, up to 30 times at two-second intervals. Seed is explicitly skipped in VPS Console mode because projects are seeded on creation.
Use start.sh to resume a stopped platform with its existing images and volumes. Use ./setup.sh when the shared images or generated configuration must also be reconciled.
Stop
./deploy/stop.sh
./deploy/stop.sh --with-proxyIn VPS mode, stop.sh iterates every /srv/projects/<name>/.env.prod and runs the production project Compose file with down --remove-orphans. It then brings down the Console. It does not pass -v, so named project volumes remain.
--with-proxy also brings down production Traefik. It has no extra effect in local mode.
Stopping the VPS platform stops every discovered project, not just the Console. Starting it again starts the Console, but deploy/start.sh does not iterate and restart the project stacks.
Restart
./deploy/restart.sh
./deploy/restart.sh --build --seedrestart.sh is exactly a full stop.sh followed by start.sh. Because its stop call does not include --with-proxy, Traefik stays running. The VPS project-start caveat from the previous section also applies.
Status
./deploy/status.shThe command reports the root stack in local mode and the Console Compose project in VPS mode. It does not enumerate the independent per-project Compose projects.
For a production project, use its generated environment explicitly:
docker compose -f deploy/docker-compose.prod.yml \
--env-file /srv/projects/<name>/.env.prod -p <name> psLogs
./deploy/logs.sh --help
./deploy/logs.sh
./deploy/logs.sh orchestrator --tail 100
./deploy/logs.sh console --since 10mThe default service is api locally and console in VPS mode. If the first argument does not start with -, it becomes the service name. Remaining arguments are passed after the service to docker compose logs -f.
This helper follows the selected root or Console stack. It does not automatically target a project stack. Project runtime logs are available through the Console, motherbase projects logs <name>, or an explicit production Compose command.
Reset
./deploy/reset.sh
./deploy/reset.sh --yes
./deploy/reset.sh --yes --keep-imagesWithout --yes, the script asks for destructive confirmation. It then:
- In VPS mode, runs each project down with
-vand removes its project directory. - Brings down both production and dev Console and Traefik definitions with
-vwhen their environment files allow it. - Uses label-based cleanup for Compose projects named
consoleandtraefik. - Brings down the legacy/root stack with
-vand removes leftover volumes ending in_db_data,_minio_data, or_console_projects. - Unless
--keep-imagesis set, removes exactlymotherbase-api:1.0.0andmotherbase-console:1.0.0. - Removes the
traefik_proxynetwork. - Removes
.env,deploy/console/.env,deploy/traefik/.env,.dev-projects, and the contents of/srv/projects.
The script does not remove the locally built dependency, orchestrator, or PostgreSQL images, and it does not delete the bind-mounted deploy/traefik/acme directory.
deploy/reset.sh returns the generated runtime state to a fresh-checkout condition and does not restart anything. Run ./setup.sh only after confirming the data loss is intended.
Docker cleanup library
deploy/docker-cleanup.sh exposes four helpers used by setup and reset:
remove_containers_by_projectremoves containers carrying a matchingcom.docker.compose.projectlabel.remove_volumes_by_projectremoves volumes with the same project label.remove_compose_project_datacalls both.remove_volume_stack_dataresolves a volume's Compose project label; without one, it removes containers attached to that volume and then the volume.
It has no command-line parser and performs nothing when executed without calling one of its functions.
Build images
./deploy/build-images.shThe script enables BuildKit and builds:
motherbase-deps:1.0.0fromdeploy/deps.Dockerfile;API_IMAGE, defaultmotherbase-api:1.0.0, from the rootDockerfile;CONSOLE_IMAGE, defaultmotherbase-console:1.0.0;ORCHESTRATION_IMAGE, defaultmotherbase-orchestrator:1.0.0, usingDOCKER_CLI_IMAGE, defaultdocker:27-cli;motherbase-postgres:1.0.0fromdeploy/postgres.Dockerfile.
Unlike the build function inside setup.sh, this helper does not accept MOTHERBASE_IMAGE_TAG, does not pin external images, and does not build API and Console in parallel.
Local host development
deploy/dev-up.sh creates traefik_proxy, starts the HTTP-only dev Traefik, and then runs the Console directly on the host with npm. It therefore requires the repository dependencies and a compatible host Node.js, unlike ./setup.sh.
Use it for interactive source development, not for a container-only installation.
Related
- Platform Console projects — the same lifecycle actions from the UI and API.
- Troubleshooting — failure modes and their diagnosis commands.