# Deploy to Adios

`adios kit deploy` creates a JavaScript app and a dedicated PostgreSQL database inside your Adios team. Start with the [quickstart requirements](quickstart.md#requirements) and a test installation with sample data. The hosted installer is still being qualified for public release.

## First deployment

If you are starting a new project, follow [Get started](quickstart.md) to generate it first. From an existing project folder containing `adios.yaml`, run:

```sh
adios login
adios kit deploy --name my-saas
```

The command uses your selected team or asks you to choose one. You can select a team explicitly:

```sh
adios kit deploy --name my-saas --team YOUR_TEAM_ID
```

Replace `YOUR_TEAM_ID` with your team ID or quoted team name. On macOS, `deploy.command` is a double-click entry point using the default installation name, `saas-kit`.

The first run asks for a verified email sender and Resend API key. It creates the database, applies migrations, builds the app, and checks its health. Open the printed landing-page URL and choose **Create an account**. The installer also prints the app at `/app/` and the kit documentation URL.

The current deployment includes CRM and shared contacts. Other product interfaces still need to be built; adding a module installs its database schema. See [Choose modules](modules.md).

## Use the bundled installer

If your Adios CLI has `adios up` and `adios auth print-token` but is missing `kit deploy`, get the versioned archive from your preview invitation. From the directory containing the archive, paste this block to create a new project and deploy it.

```sh
mkdir my-saas &&
  tar -xzf adios-saas-kit-0.1.0-dev.tar.gz -C my-saas --strip-components=1 &&
  cd my-saas &&
  adios login &&
  sh scripts/deploy.sh --name my-saas
```

From an existing kit folder, you can preview the plan first.

```sh
sh scripts/deploy.sh --name my-saas --dry-run
```

For updates and retries, run `sh scripts/deploy.sh --name my-saas` from this same folder. The script uses the Adios CLI on your path and writes the same installation record as the preview CLI command.

## Keep your installation name

Use the same name, project folder, account, and team when updating. A different name creates a separate installation with its own database.

The command keeps a private record in `.local/deploy/my-saas/state.json`. Keep this file when moving the project to another computer. It identifies the app, database, and secrets used for updates and deletion. It is excluded from Git; store a private backup alongside your operating records.

## Update the app

After reviewing and testing your code changes, rerun:

```sh
adios kit deploy --name my-saas
```

The command reuses the installation and stored provider secrets. It reapplies the selected migrations, builds the new source, and checks the app. Back up the database before changes that affect stored data. Verify the customer workflow after the update.

If a deployment stops partway through, correct the reported problem and rerun the same command. Keep its installation record. See [Troubleshooting](operations.md#troubleshooting) if it still fails.

## Stripe configuration

You can deploy before enabling payments. Once you have an app URL, follow [Set up billing](configuration.md#set-up-billing) to create your Stripe price, register the webhook, and supply the three billing settings. Redeploy the same installation to apply them.

## Delete an installation

Deletion removes this installation's app, database, customer data, and recorded Adios secrets. Back up anything you want to keep first. Preview the scope before deleting:

```sh
adios kit delete --name my-saas --dry-run
adios kit delete --name my-saas
```

The command displays the resources and asks you to type `delete my-saas`. It leaves your Adios team and unrelated apps alone. Stripe and email-provider resources must be managed separately; backup retention follows your Adios settings.

If deletion is interrupted, rerun the same delete command to continue. Use a new installation name if you later want a fresh copy. On macOS, `delete.command` targets the default `saas-kit` installation.

## More options

Use `--path /path/to/my-saas` to run from another folder. The commands also accept the CLI's global `--context` and `--config` flags when you manage more than one account.

```sh
adios kit deploy --help
adios kit deploy --name my-saas --dry-run
adios kit delete --help
```

A deploy dry run shows proposed actions without contacting Adios. It does not check credentials or capacity. For a real deployment, confirm the app URL and complete [Verify your SaaS](verification.md).
