# Windows

Use this tutorial to install SurrealDB on Windows using the SurrealDB install script, or using third-party package managers like Chocolatey or Scoop.

Both the SurrealDB database server and the [command-line tool](/docs/reference/cli/surrealdb-cli/overview.md) are packaged as a single executable file. You can install via the [install script](#installing-surrealdb-using-the-install-script), [Chocolatey](https://chocolatey.org/), or [Scoop](https://scoop.sh/).

## Installing SurrealDB using the install script

To get started, you can use the SurrealDB [install script](https://github.com/surrealdb/windows.surrealdb.com). This script securely downloads the latest version for the platform and CPU type. It installs SurrealDB into the `C:\Program Files\SurrealDB` folder, falling back to a user-specified folder if necessary.

```bash
iwr https://windows.surrealdb.com -useb | iex
```

### Updating SurrealDB

To ensure that you are using the latest stable version (`v3.2.4`), update SurrealDB using the following command.

```bash
surreal upgrade
```

### Confirming the installation

Once installed, you can run the SurrealDB command-line tool by using the `surreal` command. To check whether the installation was successful run the following command in your terminal.

```bash
surreal help
```

The result should look similar to the output below, confirming that the SurrealDB command-line tool was installed successfully.

```text title="Output"
.d8888b.                                             888 8888888b.  888888b.
d88P  Y88b                                            888 888  'Y88b 888  '88b
Y88b.                                                 888 888    888 888  .88P
 'Y888b.   888  888 888d888 888d888  .d88b.   8888b.  888 888    888 8888888K.
	'Y88b. 888  888 888P'   888P'   d8P  Y8b     '88b 888 888    888 888  'Y88b
	  '888 888  888 888     888     88888888 .d888888 888 888    888 888    888
Y88b  d88P Y88b 888 888     888     Y8b.     888  888 888 888  .d88P 888   d88P
 'Y8888P'   'Y88888 888     888      'Y8888  'Y888888 888 8888888P'  8888888P'


SurrealDB command-line interface and server

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)

```

## Installing SurrealDB using Chocolatey

If you use the [Chocolatey](https://chocolatey.org/) package manager, then you can quickly install SurrealDB with one command. This will install a single executable containing both the command-line tool and the SurrealDB server.

```bash
choco install surreal
```

### Updating SurrealDB

To ensure that you are using the latest stable version (`v3.2.4`), update SurrealDB using the following command.

```bash
choco update surreal
```

## Installing SurrealDB using Scoop

If you use the [Scoop](https://scoop.sh/) package manager, then you can quickly install SurrealDB with one command. This will install a single executable containing both the command-line tool and the SurrealDB server.

```bash
scoop install surrealdb
```

### Updating SurrealDB

To ensure that you are using the latest stable version (`v3.2.4`), update SurrealDB using the following command.

```bash
scoop update surrealdb
```

## Troubleshooting

### 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](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version).
