> Full SurrealDB documentation index: https://surrealdb.com/docs/llms.txt

# version

surreal db version prints the database component version with its platform and architecture, or the version of a remote server with --endpoint. The launcher has its own surreal version and surreal --version.

Output the version of the database component, or the version of a remote server. The launcher has its own version commands, described [below](#launcher-versions).

<Synopsis>
surreal db version [OPTIONS]
</Synopsis>

<OptionsTable
    title="Options"
    options={[
        {
            "name": "--endpoint",
            "short": "-e",
            "value": "<ENDPOINT>",
            "description": "Remote database server URL to connect to. When given, only the server's version number is printed."
        },
        {
            "name": "--log",
            "short": "-l",
            "value": "<LOG>",
            "default": "info",
            "env": "SURREAL_LOG",
            "description": "The logging level for the command-line tool. Possible values: `none`, `full`, `error`, `warn`, `info`, `debug`, `trace`."
        }
    ]}
/>

## Example usage

To display the version of the database component, along with the platform and architecture, run `surreal db version` without any further arguments.

```bash
surreal db version
```

Sample output:

```text
3.3.4 for macos on aarch64
```

If an endpoint is specified, only the version number of the server is displayed.

```bash
surreal db version --endpoint http://localhost:8000
```

Output:

```text
3.3.4
```

## Launcher versions {#launcher-versions}

`surreal version` and `surreal --version` belong to the launcher and do not forward to the database. `surreal version` prints a table with each component, the version that runs, where that version came from, and its path. `surreal --version` prints the launcher version and the version of each component.

```bash
surreal version
```

```text
COMPONENT  VERSION  SOURCE  INSTALLED  PATH
cli        0.1.0    cli                /usr/local/bin/surreal
db         3.3.4    pinned  3.3.4      ~/.surrealdb/components/db/3.3.4/surreal-db
cloud      0.1.0    pinned  0.1.0      ~/.surrealdb/components/cloud/0.1.0/surreal-cloud
```

```bash
surreal --version
```

```text
Surreal CLI 0.1.0
  db      3.3.4
  cloud   0.1.0
```

A component that is not installed has a blank row in the table and reads `not installed` in `surreal --version`. To query a server, or to print the database version alone, use `surreal db version`. See the [launcher reference](/docs/reference/cli/launcher.md) for the other version commands, including `surreal install`, `surreal use` and `surreal upgrade`.

## Command help

To see the help information and usage instructions, in a terminal run the `surreal db version --help` command without any further arguments. This command gives general information on the arguments, inputs, and additional options for the `version` command.

```bash
surreal db version --help
```

The output of the above command:

```text
Output the command-line tool and remote server version information

Usage: surreal version [OPTIONS]

Options:
  -e, --endpoint <ENDPOINT>  Remote database server url to connect to
  -h, --help                 Print help

Logging:
  -l, --log <LOG>                              The logging level for the command-line tool [env: SURREAL_LOG=] [default: info] [possible
                                               values: none, full, error, warn, info, debug, trace]
      --log-format <LOG_FORMAT>                The format for terminal log output [env: SURREAL_LOG_FORMAT=] [default: text] [possible
                                               values: text, json]
      --log-socket <LOG_SOCKET>                Send logs to the specified host:port [env: SURREAL_LOG_SOCKET=]
      --log-file-level <LOG_FILE_LEVEL>        Override the logging level for file output [env: SURREAL_LOG_FILE_LEVEL=] [possible values:
                                               none, full, error, warn, info, debug, trace]
      --log-otel-level <LOG_OTEL_LEVEL>        Override the logging level for OpenTelemetry output [env: SURREAL_LOG_OTEL_LEVEL=] [possible
                                               values: none, full, error, warn, info, debug, trace]
      --log-socket-level <LOG_SOCKET_LEVEL>    Override the logging level for unix socket output [env: SURREAL_LOG_SOCKET_LEVEL=] [possible
                                               values: none, full, error, warn, info, debug, trace]
      --log-socket-format <LOG_SOCKET_FORMAT>  The format for socket output [env: SURREAL_LOG_SOCKET_FORMAT=] [default: text] [possible
                                               values: text, json]
      --log-file-enabled                       Whether to enable log file output [env: SURREAL_LOG_FILE_ENABLED=]
      --log-file-path <LOG_FILE_PATH>          The directory where log files will be stored [env: SURREAL_LOG_FILE_PATH=] [default: logs]
      --log-file-name <LOG_FILE_NAME>          The name of the log file [env: SURREAL_LOG_FILE_NAME=] [default: surrealdb.log]
      --log-file-format <LOG_FILE_FORMAT>      The format for log file output [env: SURREAL_LOG_FILE_FORMAT=] [default: text] [possible
                                               values: text, json]
      --log-file-rotation <LOG_FILE_ROTATION>  The log file rotation interval [env: SURREAL_LOG_FILE_ROTATION=] [default: daily] [possible
                                               values: daily, hourly, never]
```
