# Configuration
URL: /docs/configuration
LLM index: /llms.txt
Description: Global CLI options, environment variables, and deployment configuration.

# Configuration

All global options must be placed **before** the database subcommand. The general command shape is:

```bash
sql-studio [OPTIONS] <SUBCOMMAND> [ARGS...]
```

Every option can also be set via its corresponding environment variable, which is useful for Docker or CI environments where you don't want to pass flags explicitly.

## Global Options

| Option | Short | Description | Default | Env Var |
|---|---|---|---|---|
| `--address` | `-a` | Address and port to bind to | `127.0.0.1:3030` | `ADDRESS` |
| `--timeout` | `-t` | Timeout for queries from the query page | `5secs` | `TIMEOUT` |
| `--base-path` | `-b` | Base URL path for the UI (e.g. `/sql-studio`) | _(none)_ | `BASE_PATH` |
| `--no-browser` | | Don't open the URL in the system browser | `false` | `NO_BROWSER` |
| `--no-shutdown` | | Don't show the shutdown button in the UI | `false` | `NO_SHUTDOWN` |

## Timeout Format

The `--timeout` option accepts human-readable durations. Pass `5secs`, `30secs`, `1min`, or `2min 30secs`. The timeout applies only to queries run from the Query Editor page — browsing tables and the overview are not affected.

## Binding to All Interfaces

By default SQL Studio binds to `127.0.0.1:3030`, which is only reachable from localhost. To expose it on your network or inside a container, bind to `0.0.0.0`:

```bash
sql-studio --address=0.0.0.0:3030 sqlite ./mydb.sqlite
```

## Base Path

Use `--base-path` when you're serving SQL Studio behind a reverse proxy at a sub-path:

```bash
sql-studio --base-path=/sql-studio sqlite ./mydb.sqlite
```

The UI will then be reachable at `http://your-host/sql-studio`.

## Logging

SQL Studio reads the `RUST_LOG` environment variable to control log output. Set it before running the binary:

```bash
RUST_LOG=debug sql-studio sqlite ./mydb.sqlite
```

Standard Rust log levels (`error`, `warn`, `info`, `debug`, `trace`) are supported.

## Docker Example

This combines several options into a production-ready Docker invocation:

```bash
docker run -p 3030:3030 frectonz/sql-studio /bin/sql-studio \
  --no-browser \
  --no-shutdown \
  --address=0.0.0.0:3030 \
  postgres \
  postgres://user:password@db-host:5432/mydb
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
