#  Install Memgraph on Windows with WSL

This article briefly outlines the basic steps necessary to install and run
Memgraph on Windows with the Windows Subsystem for Linux.

> **Warning**
>
> Newer versions of Memgraph might not be backward
> compatible with older versions and you might not be able to load storage
> snapshots between different versions. In that case, please contact the Memgraph
> team and we'll help with the migration as much as possible.

## Prerequisites

Before you proceed with the installation guide make sure that you have:

- The latest **Memgraph Ubuntu package** which can be downloaded from the
  [Memgraph Download Hub](https://memgraph.com/download/).
- Installed **Windows Subsystem for Linux (WSL)**. For detailed instructions,
  refer to the [Microsoft
  documentation](https://docs.microsoft.com/en-us/windows/wsl/install).

## Installation guide

### Start Ubuntu

Run the command below from PowerShell to launch Ubuntu:

```
ubuntu
```

> **Info**
>
> You can also run Ubuntu from the *Start* menu.

### Install Memgraph

To set up the Memgraph database, use the command below in the Ubuntu terminal:

/Users/<windows username>/Downloads/memgraph_<version>.deb" page="install-memgraph/wsl" os="wsl"/>

> **Info**
>
> You can also obtain the Memgraph package using the [direct download link](https://memgraph.com/docs/getting-started/install-memgraph/direct-download-links). On that page, you will always find the links to the latest release. Make sure to replace the link in the command below with the most recent one:
> ```
wget [YOUR_DIRECT_DOWNLOAD_LINK_HERE] -O memgraph.deb 
sudo dpkg -i memgraph.deb
```
>
> For example:
>
> ```
wget https://download.memgraph.com/memgraph/v3.13.0/x86_64-deb/memgraph_3.13.0-1_amd64.deb -O memgraph.deb
sudo dpkg -i memgraph.deb
```    
>
> For the latest version of Memgraph, replace the version in the download command
> with the one from the [direct download
> links](https://memgraph.com/docs/getting-started/install-memgraph/direct-download-links) page.

After the installation is done Memgraph will start automatically. 

### Verify that Memgraph is running

To verify that Memgraph is running, run the following:

```
sudo journalctl --unit memgraph
```

If successful, you should receive an output similar to the following:

```
You are running Memgraph vX.X.X
```

> **Info**
>
> If the Memgraph database instance is not running, you can start it explicitly:
>
> ```
sudo runuser -l memgraph -c '/usr/lib/memgraph/memgraph'
```
>
> If successful, you should receive an output similar to the following:
>
> ```
You are running Memgraph vX.X.X
```

If you want to start Memgraph with different configuration settings, check out
the [Configuration section](#configuration).

At this point, Memgraph is ready for you
to [submit queries](https://memgraph.com/docs/querying).

> **Warning**
>
> Potential installation error You could get errors while installing the package
> with the above commands if you don't have all of Memgraph's dependencies
> installed. The issues mostly look like the following:
>
> ```
dpkg: error processing package memgraph (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 memgraph
```
>
> To install missing dependencies and finish the installation of the Memgraph
> package, just issue the following command:
>
> ```
sudo apt-get install -f
```
>
> The above command will install all missing dependencies and will finish
> configuring the Memgraph package.

## Configuration

The Memgraph configuration file is available at `/etc/memgraph/memgraph.conf`. If the
configuration file is altered, Memgraph needs to be restarted. 

To learn about
all the configuration options, check out the [Reference
guide](https://memgraph.com/docs/database-management/configuration).

## Troubleshooting

### Accessing files from your Windows system

Usually, you can find the Windows users directories in this location:

```
/mnt/<drive>/Users/<username>
```

### Unable to install the Memgraph package with `dpkg`

While running the following `dpkg` command:

```bash
sudo dpkg -i /mnt/<drive>/Users/<windows username>/Downloads/memgraph_<version>.deb
```

you may encounter errors that resemble the following:

```
dpkg: error processing package memgraph (--install): dependency problems -
leaving unconfigured Errors were encountered while processing: memgraph
```

These errors indicate that you don’t have all of the necessary dependencies
installed. To install the missing dependencies and finish the installation,
issue the following command:

```
sudo apt-get install -f
```

### Multiple notes when starting Memgraph

As of Memgraph 3.13, the package installs the Python libraries used by the
bundled query modules — including [NumPy](https://numpy.org/), [SciPy](https://www.scipy.org/) and [NetworkX](https://networkx.org/) — automatically
during package installation (the machine needs network access at install
time). If that automatic installation was skipped (`MG_SKIP_PYTHON_DEPS=1`) or
failed, Memgraph reports it with a note like this on startup:

```
You are running Memgraph v3.13.0
To get started with Memgraph, visit https://memgr.ph/start
NOTE: Please install networkx, numpy, scipy to be able to use proxied NetworkX algorithms. E.g., CALL nxalg.pagerank(...).
```

In that case, install the missing libraries manually as the `memgraph` user
(they must land in the `memgraph` user's environment, since the embedded
interpreter runs as `memgraph`):

```bash
sudo runuser -l memgraph -c 'python3 -m pip install --user networkx numpy scipy'
```

If you are not interested in working with query modules that depend on these
libraries, you can ignore the warnings.

For more information on the installation process and for additional questions,
visit the **[Help Center](https://memgraph.com/docs/help-center)** page.
