SurrealDB World   |   Join us in September

Back to top
Documentation Installation Run a single-node, in-memory server

Run a single-node, in-memory server

For the purposes of getting started with SurrealDB quickly, we will start an in-memory database which does not persist data on shutdown. This database is great for development and testing.

user@localhost % surreal start memory

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 trace level logging, resulting in most logs being output to the terminal.

user@localhost % surreal start --log trace memory

In order to keep SurrealDB secure, the database disables root-level authentication if a password is not set. To set a root-level authentication login, use the --user and --pass command-line arguments. The following command starts the database with a top-level user named root with a password also set to root.

user@localhost % surreal start --log trace --user root --pass root memory

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.

user@localhost % surreal start --log trace --user root --pass root --bind 0.0.0.0:8080 memory

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

user@localhost % surreal start --log trace --user root --pass root --bind 0.0.0.0:8080 memory
[2023-04-03 08:45:42] INFO  surrealdb::iam Root authentication is enabled
[2023-04-03 08:45:42] INFO  surrealdb::iam Root username is 'root'
[2023-04-03 08:45:42] INFO  surrealdb::dbs Database strict mode is disabled
[2023-04-03 08:45:42] INFO  surrealdb::kvs Starting kvs store in memory
[2023-04-03 08:45:42] INFO  surrealdb::kvs Started kvs store in memory
[2023-04-03 08:45:42] INFO  surrealdb::net Starting web server on 0.0.0.0:8080
[2023-04-03 08:45:42] INFO  surrealdb::net Started web server on 0.0.0.0:8080

For details on the start command, and all of the available configuration options and arguments, view the start command documentation.