# Quickstart

Install the Volcano CLI, run a function locally, then deploy it to the cloud.

Go from zero to a deployed function with the Volcano CLI — develop locally
first, then push the same project to the cloud.

## 1. Install the CLI

```bash
npm install -g @volcano.dev/cli
volcano --help
```

Other methods (pnpm, Bun, Homebrew) are in [installation](https://docs.volcano.dev/platform/getting-started/installation.md).

## 2. Sign up

```bash
volcano signup
```

This creates your account and logs you in.

## 3. Scaffold a project

```bash
volcano init javascript      # also: nextjs, python, ruby
```

This creates a starter project with a sample function under `volcano/functions/`
and a `volcano-config.yaml` describing it.

## 4. Develop locally

Start a full Volcano stack on your machine:

```bash
volcano start
volcano status
```

While the local environment is running, the top-level commands act on it.
Deploy the project and invoke the scaffolded function:

```bash
volcano deploy
volcano functions invoke hello --payload '{"name":"Ada"}'
```

`volcano deploy` deploys everything the project holds — variables, functions,
frontends, and `volcano-config.yaml` — and waits until it is live. You'll get
the function's JSON response. Edit `volcano/functions/hello.js`, run
`volcano deploy` again, and invoke again to iterate — no cloud round-trip.

Add `--with-migrations` once your project has migrations in
`volcano/migrations`. Migrations aren't tracked, so every file runs again on
each `--with-migrations` run: write them to be safe to repeat, or leave the
flag out once they have run.

## 5. Deploy to the cloud

Create a cloud project and select it:

```bash
volcano projects create my-app
volcano use my-app
```

`volcano/volcano.env` holds the local server's URL and keys, which the cloud
project can't use, so give the cloud project its own env file. Prefix a command
with `cloud` to target the cloud project explicitly:

```bash
echo 'GREETING=Hello from the cloud' > volcano/cloud.env
volcano cloud deploy --env-file volcano/cloud.env
volcano cloud functions invoke hello --payload '{"name":"Ada"}'
```

Your function now runs on Volcano's managed infrastructure, and its greeting
comes from `volcano/cloud.env`. `volcano cloud deploy` refuses an env file that
still holds the local server's values. The deploy also applied
`volcano-config.yaml`, which manages the project's settings (variables,
schedules, auth, and function and frontend settings) from one manifest — see
[declarative config](https://docs.volcano.dev/platform/projects/configuration.md).

## What's next

| Guide                                                 | Description                                       |
| ----------------------------------------------------- | ------------------------------------------------- |
| [Functions](https://docs.volcano.dev/platform/functions/overview.md)                 | Runtimes, dependencies, and environment variables |
| [Add a database](https://docs.volcano.dev/platform/databases/quick-start.md)         | Provision PostgreSQL with row-level security      |
| [Add authentication](https://docs.volcano.dev/platform/authentication/quickstart.md) | Let users sign up and sign in                     |
| [Deploy a frontend](https://docs.volcano.dev/platform/frontends/overview.md)         | Host a Next.js site on Volcano                    |
| [Deploy to production](https://docs.volcano.dev/platform/guides/production.md)       | Ship your project to the cloud                    |
| [View logs](https://docs.volcano.dev/platform/functions/logs.md)                     | Debug with `volcano cloud functions logs`         |

For the full command set, see the [CLI reference](https://docs.volcano.dev/cli.md) or run
`volcano <command> --help`.
