Back to top
Documentation Command-line tool Start command

Start command

The start command starts a SurrealDB server in memory, on disk, or in a distributed setup.

Make sure you’ve installed SurrealDB — it should only take a second!

Command options

Argument Description
-b / --bind Optional Sets the hostname or ip address to listen for connections on

Default is 0.0.0.0:8000

-l / --log Optional Sets the logging level for the database server

Can be one of warn, info, debug, trace, full

-u / --user Optional Sets the master username for the database

Default is root

-p / --pass Optional Sets the master password for the database
-s / --strict Optional Sets whether strict mode is enabled on this database instance
Positional argument
Argument Description
path Optional Sets the database path used for storing data

Can be one of memory, file://<path>, tikv://<addr>

Example usage

To display the current command-line tool version, along with the platform and architecture, in a terminal run the surreal start command with the required arguments.

user@localhost % surreal start --log trace --user root --pass root memory
[2022-07-28 15:50:34] INFO  surrealdb::iam Root authentication is enabled
[2022-07-28 15:50:34] INFO  surrealdb::dbs Database strict mode is disabled
[2022-07-28 15:50:34] INFO  surrealdb::kvs Starting kvs store in memory
[2022-07-28 15:50:34] INFO  surrealdb::kvs Started kvs store in memory
[2022-07-28 15:50:34] INFO  surrealdb::net Starting web server on 0.0.0.0:8000
[2022-07-28 15:50:34] INFO  surrealdb::net Started web server on 0.0.0.0:8000

Command help

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

user@localhost % surreal start --help
Start the database server

USAGE:
    surreal start [OPTIONS] [--] [path]

ARGS:
    <path>    Database path used for storing data [default: memory]

OPTIONS:
        --addr <addr>          The allowed networks for master authentication [default:
                               127.0.0.1/32]
    -b, --bind <bind>          The hostname or ip address to listen for connections on [default:
                               0.0.0.0:8000]
    -h, --help                 Print help information
    -k, --key <key>            Encryption key to use for on-disk encryption
        --kvs-ca <kvs-ca>      Path to the CA file used when connecting to the remote KV store
        --kvs-crt <kvs-crt>    Path to the certificate file used when connecting to the remote KV
                               store
        --kvs-key <kvs-key>    Path to the private key file used when connecting to the remote KV
                               store
    -l, --log <log>            The logging level for the database server [default: info] [possible
                               values: warn, info, debug, trace, full]
    -p, --pass <pass>          The master password for the database
    -s, --strict               Whether strict mode is enabled on this database instance
    -u, --user <user>          The master username for the database [default: root]
        --web-crt <web-crt>    Path to the certificate file for encrypted client connections
        --web-key <web-key>    Path to the private key file for encrypted client connections