Skip to content

Running

/

Installation

Windows

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 install the same surreal.

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 | iex

irm | 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))) -NoDb

The 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.

Use -Version to install and pin a database release.

& ([scriptblock]::Create((irm https://windows.surrealdb.com))) -Version <version>

SurrealDB 4.0 is in beta. To install it, use -Beta instead. See Install the beta.

Once installed, surreal upgrades itself and every installed component. The database stays on its current major line.

surreal upgrade

To move the database to another release, name it: surreal upgrade db@<version>. See Managing components.

Run the following command to check that the database component runs.

surreal db version
Sample output
4.0.0 for windows on x86_64

To list surreal and every component with the version that runs, use surreal list.

The Chocolatey and Scoop packages install surreal, the same command-line tool as the install script. Install the database with surreal afterwards, or let it install the first time you run a surreal db command:

choco install surreal
surreal install db
scoop install surrealdb
surreal install db

surreal then installs, upgrades and runs the database as a component, so surreal db start and surreal upgrade work as they do after the install script. The package manager updates only surreal itself:

choco upgrade surreal
scoop update surrealdb

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.

Was this page helpful?