SurrealDB
SurrealDB Docs Logo

Enter a search query

Navigation
Table of Contents

Run a single-node, on-disk server

For the purposes of getting started with SurrealDB quickly, we will start a RocksDB database which persists data on the filesystem. This configuration is great for trying out the database and small deployments.

surreal start rocksdb://mydatabase.db

The default logging level for the database server is info, resulting in any informational logs to be output to the standard output. To control the logging verbosity, specify the --log argument. The following command starts the database with debug level logging, resulting in more logs being output to the terminal. If extra verbosity is not needed, specify a lower level or simply remove the flag, which will default to the info level.

surreal start --log debug rocksdb://mydatabase.db

The SurrealDB server runs with authentication enabled by default. To disable it, the --unauthenticated flag can be passed in.

surreal start --unauthenticated rocksdb://mydatabase.db

However, for anything but simple testing, it is better to configure your initial root-level user by setting the --user and --pass command-line arguments. The following command starts the database with a top-level user named root with a password set to secret. The root user will be persisted in storage, which means you don’t have to include the command line arguments next time you start SurrealDB.

surreal start --user root --pass secret rocksdb://mydatabase.db

In order to change the default port that SurrealDB uses for web connections and from database clients you can use the --bind argument. The following command starts the database on port 8080.

surreal start --user root --pass secret --bind 0.0.0.0:8080 rocksdb://path/to/mydatabase

After running the above command, you should see the SurrealDB server start up successfully.

surreal start --user root --pass secret --bind 0.0.0.0:8080 rocksdb://mydatabase.db 2023-08-30T15:06:34.788739Z INFO surreal::dbs: βœ…πŸ”’ Authentication is enabled πŸ”’βœ… 2023-08-30T15:06:34.788821Z INFO surrealdb::kvs::ds: Starting kvs store in file:mydatabase.db 2023-08-30T15:06:34.788859Z INFO surrealdb::kvs::ds: Started kvs store in file:mydatabase.db 2023-08-30T15:06:34.789222Z INFO surrealdb::kvs::ds: Initial credentials were provided and no existing root-level users were found: create the initial user 'root'. 2023-08-30T15:06:35.205123Z INFO surrealdb::node: Started node agent 2023-08-30T15:06:35.205827Z INFO surrealdb::net: Started web server on 0.0.0.0:8080

For details on the different commands available, visit the CLI tool documentation.