> ## Documentation Index
> Fetch the complete documentation index at: https://docs.levelrail.com/llms.txt
> Use this file to discover all available pages before exploring further.

# One command quickstart

> Deploy a project with `levelrail-cli up`, which infers the name, port and build, then keep every advanced flag when you need it.

If your project is in a git repository with a remote, three commands take it from your laptop to a running app on your server:

```bash theme={"dark"}
levelrail-cli login --device
levelrail-cli up --with postgres
levelrail-cli open shop
```

`up` reads the directory, works out how to build it, creates the app, creates and connects the database, builds from your git remote and prints the app's URL. Push your code to the remote first: the server builds from git, not from your working copy.

## What `up` infers

Each value comes from the first of these that has one: a flag, your app spec (`app.yaml`), detection, a default. `up` prints every value with where it came from, so you know what to change.

| Value | Flag | App spec | Detection | Default |
| - | - | - | - | - |
| Name | `--name` | the service key | the directory name | none |
| Port | `--port` | `port` | Dockerfile `EXPOSE`, or the framework (Node 3000, Python 8000, Go and Java 8080) | none |
| Build | none | `build.type` | Dockerfile, otherwise Railpack, or a static site for a bare `index.html` | none |
| Repository | `--repo` | none | the `origin` remote | none |
| Branch | `--ref` | none | the current branch | `main` |
| Image repo | none | none | none | the app name |
| Replicas, strategy | `--replicas`, `--strategy` | `replicas`, `strategy` | none | 1, blue-green |
| Memory, CPU | `--memory`, `--cpu` | `resources` | none | unlimited |
| Domain | `--domain` | `domains` | none | the automatic URL |

A Node project without a Dockerfile works: it builds with Railpack. A project in a subdirectory of a monorepo (`levelrail-cli up apps/web`) builds from that subdirectory.

## See the plan first

`--dry-run` prints what was inferred and the exact commands `up` runs, and changes nothing:

```bash theme={"dark"}
levelrail-cli up --dry-run --with postgres --domain shop.example.com --memory 512Mi
```

```text theme={"dark"}
up: .
  note: detected Node.js (Express)
  name            shop                                     (detected)
  port            3000                                     (detected)
  build           railpack                                 (detected)
  repo            https://github.com/acme/shop.git         (git remote)
  ref             main                                     (default)
  image repo      shop                                     (default)
  replicas        1                                        (default)
  strategy        blue-green                               (default)
  domain          shop.example.com                         (flag)
  resources       512Mi                                    (flag)
  database        shop-postgres (postgres)                 (default)
plan (new app):
  levelrail-cli apps create --name shop --port 3000 --repo https://github.com/acme/shop.git --ref main --image-repo shop --build-type railpack
  levelrail-cli apps scale shop --memory 512Mi
  levelrail-cli databases create --name shop-postgres --engine postgres --version <engine default>
  levelrail-cli apps connect shop shop-postgres --env-var DATABASE_URL
  levelrail-cli apps domains add shop shop.example.com
```

On a terminal, `up` asks for confirmation before it changes anything. Pass `--yes` in scripts.

## Run it again

`up` is safe to repeat. A second run finds the app, database, connection and domain it already made, changes only settings that differ from what you asked for, and rebuilds from your latest push. Nothing is created twice.

If a step fails partway, `up` stops and says what to run. For example, if the database exists but connecting it fails, no build starts, and the message names `levelrail-cli apps connect` and says re-running `up` is safe.

## Advanced flags

| Flag | What it does |
| - | - |
| `--name`, `--port` | Override the inferred name and port. |
| `--domain` | Add a domain after the deploy, with automatic DNS when a provider is connected. |
| `--with postgres,redis` | Create and connect databases. Use `postgres:16` to pin a version. The first database of a kind is injected as `DATABASE_URL`, `REDIS_URL` or `MONGODB_URL`. |
| `--replicas`, `--strategy` | Replica count and `rolling`, `recreate` or `blue-green`. |
| `--memory`, `--cpu` | Resource limits, for example `512Mi` or `2Gi` and `0.5` cores. |
| `--repo`, `--ref` | Build a different repository or branch. |
| `--secret KEY=VALUE` | Give a secret that your `app.yaml` declares as required. |
| `--dry-run`, `--yes` | Print the plan only, or skip the confirmation prompt. |

For anything `up` does not cover, use the commands it expands to: [`apps create`](/cli-reference), `apps scale`, `apps connect`, `apps domains add`. An `app.yaml` in the project replaces detection, and flags still override it.

## Day to day

```bash theme={"dark"}
levelrail-cli logs shop
levelrail-cli env set shop LOG_LEVEL=debug --apply
levelrail-cli apps scale shop --memory 1Gi
levelrail-cli rollback shop
levelrail-cli backup shop-postgres
```

`rollback` without `--image` goes back to the previous successful deploy. `backup` uses your only backup target when there is exactly one. Run `levelrail-cli help` for the everyday verbs and `levelrail-cli help advanced` for the rest.

See the [CLI reference](/cli-reference) for every command and the [getting started guide](/getting-started) for the server install.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.