What install.sh does
This page documents exactly what happens when you run:
curl -fsSL https://install.deepsql.ai/install.sh | bashIt’s the same script that runs inside the CloudFormation deploy — there’s no second installer.
The 14 phases, in order
Section titled “The 14 phases, in order”-
Bootstrap from the internet (if needed).
When piped from
curl | bash, the script has no localdocker-compose.yml. It resolves which version to install:DEEPSQL_SELF_HOST_REFenv var if set (explicit pin, e.g.v1.0.0ormain)- Latest GitHub release tag via
api.github.com/repos/DeepSQLAI/deepsql-self-host/releases/latest mainas a fallback if the API is unreachable or there are no releases
It then downloads that ref’s repo archive, extracts to
~/.deepsql/self-host/, and re-executes itself from there. If you ran the script from a local checkout, this step is skipped. -
Capture preset env vars.
Reads
AZURE_OPENAI_KEY,AZURE_OPENAI_ENDPOINT,DEEPSQL_INITIAL_ADMIN_EMAIL,DEEPSQL_INITIAL_ADMIN_PASSWORD, image overrides, and port overrides from your environment so they win over.envdefaults. -
Auto-install prerequisites.
Detects your host’s package manager (
dnf,yum,apt-get,apk,pacman,zypper, orbrewon macOS) and installs any ofcurl,tar,opensslthat are missing. Architecture-agnostic — the same logic works on x86_64 and arm64. You may be prompted for your sudo password on Linux. -
Ensure Docker is available.
If
dockerisn’t already installed:- Amazon Linux 2023: uses
dnf install docker(the officialget.docker.comscript doesn’t support AL2023). Also installs the Compose v2 plugin manually from the GitHub release. - Other Linux: downloads and runs
get.docker.com(Ubuntu, Debian, Fedora, RHEL, etc.). Verifies Compose v2 plugin is present; downloads it from GitHub if missing. - macOS: runs
brew install --cask dockerand launches Docker Desktop.
Then waits up to ~3 minutes for the Docker daemon to come up. On Linux, falls back to
sudo dockerif the current user can’t reach the daemon directly. - Amazon Linux 2023: uses
-
Create
.envfrom the template (if it doesn’t already exist).Copies
.env.example→.env. On subsequent runs, your existing.envis preserved. Image refs in the template are pinned to a specific version tag (e.g.:1.0.0). -
Load
.envinto the current shell.Parses
.envline by line and exports eachKEY=VALUE. -
Fetch bundled LLM configuration.
Silently
curls an obscure config URL oninstall.deepsql.aiand extractsAZURE_OPENAI_KEYandAZURE_OPENAI_ENDPOINT. If your.envalready has real values (not placeholders), the remote config is ignored. Skip withDEEPSQL_SKIP_REMOTE_CONFIG=true. -
Auto-generate security secrets.
For any of these that are still placeholders, the script generates a fresh value with
openssl rand:SECURITY_JWT_SECRET(64 bytes, base64)ENCRYPTION_KEY(32 bytes, base64)DB_PASSWORD(16 bytes, base64)ADMIN_BOOTSTRAP_SECRET(32 bytes, base64)
-
Prompt for admin credentials (only on first install or if bootstrap is still enabled).
Asks for an email (default:
admin@yourcompany.com) and a 12+ character password (entered twice). Skip the prompts entirely by setting both as environment variables before running. -
Pull DeepSQL images.
docker compose pull backend frontendfromghcr.io. Skip withDEEPSQL_SKIP_IMAGE_PULL=trueif you’ve pre-loaded images locally. -
Start the stack.
docker compose up -d postgres valkeyand wait for health.- Sync the generated
DB_PASSWORDwith the running Postgres instance. docker compose up -d(backend + frontend).- Run schema migrations: enable
pg_stat_statements, create thedb-schedulertask table. - Wait for backend (
/api/actuator/health) and frontend HTTP endpoints to respond.
-
Bootstrap the initial admin user.
Calls the backend’s internal admin-reset endpoint (gated by
ADMIN_BOOTSTRAP_SECRET) to create/reset the admin login. Then disables the bootstrap flag in.envand restarts the backend so the secret can no longer be used. -
Install the MCP package and auto-login the CLI.
Runs
npm install -g @deepsql/mcp@latest, then authorizes the CLI against the local instance using your admin credentials viadeepsql login --password --password-stdin --url http://localhost:<backend-port>. The long-lived MCP token is persisted to~/.config/deepsql/auth.json.Skipped if
DEEPSQL_SKIP_MCP=trueornpmisn’t installed. See MCP & coding agents for details. -
Configure MCP for your coding agents.
Prompts you to pick from Claude Code, Codex, Cursor (or all, or skip). Auto-skipped if there’s no TTY (CloudFormation UserData, CI). For each selection:
Terminal window deepsql mcp config --install --for <agent> --force
Idempotency
Section titled “Idempotency”install.sh is safe to re-run.
- Existing
.envvalues are preserved - Auto-generated secrets are only generated once (subsequent runs see real values and skip)
- Admin bootstrap is disabled after first successful run, so re-runs won’t reset the admin password
docker compose up -donly restarts changed services- The deepsql CLI login is re-attempted; it overwrites any existing token
If you want to start fresh, run ./scripts/uninstall.sh first (purges volumes by default — see Uninstall).
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Generic failure — see the last printed error |
The script uses set -euo pipefail, so it fails fast on the first error. Look at the message immediately above the exit for the cause.
When running via CloudFormation UserData, the full installer output is written to /var/log/deepsql-install.log on the instance. When running interactively, output goes to your terminal.
When something goes wrong, collect a diagnostic bundle and attach it to your support ticket.