The PowerShell install script installs surreal, the SurrealDB command-line tool, and the database with it. surreal installs, updates and runs the database as a component, so surreal db start works from then on without a network connection. Chocolatey and Scoop are also available.
Installing with the PowerShell install script
The install script downloads surreal and the database, checks each download against its published SHA-256, and installs surreal.exe into C:\Program Files\SurrealDB from an elevated shell, or %LOCALAPPDATA%\SurrealDB otherwise. It adds that folder to your user PATH.
irm https://windows.surrealdb.com | iexirm | iex cannot pass options. To pass them, run the script as a script block. The database is installed by default; -NoDb installs surreal alone, and the database installs on first use instead.
& ([scriptblock]::Create((irm https://windows.surrealdb.com))) -NoDbThe SURREAL_CLI_INSTALL_DB environment variable (1 or 0) sets the same switch for callers that cannot pass options. See Install the SurrealDB CLI for every option, including installing the Cloud component alongside.
Installing a specific version of the database
Use -Version to install and pin a database release.
& ([scriptblock]::Create((irm https://windows.surrealdb.com))) -Version <version>Updating
Once installed, surreal upgrades itself and every installed component. The database stays on its current major line.
surreal upgradeTo move the database to another release, name it: surreal upgrade db@<version>. See Managing components.
Confirming the installation
Run the following command to check that the database component runs.
surreal db version3.3.4 for windows on x86_64To list surreal and every component with the version that runs, use surreal version.
Installing SurrealDB using Chocolatey
If you use the Chocolatey package manager, then you can quickly install SurrealDB with one command. This installs the database as a single surreal executable.
choco install surrealUpdating SurrealDB
To ensure that you are using the latest stable version (v3.3.4), update SurrealDB using the following command.
choco update surrealInstalling SurrealDB using Scoop
If you use the Scoop package manager, then you can quickly install SurrealDB with one command. This installs the database as a single surreal executable.
scoop install surrealdbUpdating SurrealDB
To ensure that you are using the latest stable version (v3.3.4), update SurrealDB using the following command.
scoop update surrealdbTroubleshooting
DLLs not installed
Attempting to open the executable at the install location throws errors that the following DLLs are not installed
If you encounter an error saying that the following DLLs are not installed:
VCRUNTIME140.dll
MSVCP140.dll
VCRUNTIME140_1.dll
Then you may need to install the Microsoft Visual C++ Redistributable for Visual Studio.