Use this tutorial to install SurrealDB on Linux or Unix operating systems using the SurrealDB install script. Both the SurrealDB database server and the SurrealDB command-line tool are packaged and distributed as a single executable file which is easy to install and uninstall.
Installing SurrealDB using the install script
To get started, you can use the SurrealDB install script. This script securely downloads the latest version for the platform and CPU type. It attempts to install SurrealDB into the /usr/local/bin folder, falling back to a user-specified folder if necessary.
curl -sSf https://install.surrealdb.com | sh
Installing a specific version of SurrealDB
To install a specific version of SurrealDB, a version argument (-v or --version) can be passed to the install script.
curl -sSf https://install.surrealdb.com | sh -s -- -v <version>
Updating SurrealDB
To ensure that you are using the latest stable version (v3.0.4), update SurrealDB using the following command.
curl -sSf https://install.surrealdb.com | sh
Confirming the installation
Once installed, you can run the SurrealDB command-line tool by using the surreal command. To check whether the install was successful run the following command in your terminal.
surreal help
The result should look similar to the output below, confirming that the SurrealDB command-line tool was installed successfully.
To get started using SurrealDB, and for guides on connecting to and building applications on top of SurrealDB, check out the SurrealDB documentation (https://surrealdb.com/docs).
If you have questions or ideas, join the SurrealDB community (https://discord.gg/surrealdb).
If you find a bug, submit an issue on Github (https://github.com/surrealdb/surrealdb/issues).
We would love it if you could star the repository (https://github.com/surrealdb/surrealdb).
----------
USAGE: surreal [SUBCOMMAND]
OPTIONS: -h, --help Print help information
SUBCOMMANDS: start Start the database server import Import a SQL script into an existing database export Export an existing database into a SQL script version Output the command-line tool version information sql Start an SQL REPL in your terminal with pipe support help Print this message or the help of the given subcommand(s)