# Mount your SFTP files as a drive on Windows or Linux
You can make your server files appear in Windows File Explorer or in a regular Linux folder. Then you can open, drag and edit them with programs on your computer without downloading and uploading every file by hand.

The drive is **not a copy**: it shows what is on the server right now. If you delete a file from the drive, you also delete it from the server.

:::warning{title="Back up important files before changing them"}

Do not edit worlds, databases or other files while the server is writing to them. For those changes, stop the server from the dashboard first and wait until it shows **Stopped**. Losing your internet connection while saving can also leave a file incomplete.

:::

## Before you start: get the four connection details

1. Open your server in the dashboard.
2. Pick **Data Volume** in the side menu.
3. Find the **SFTP file transfer** card and keep the page open. If SFTP is off, click **Turn on**.

You need these four values:

| In this guide | Copy it from | Made-up example |
| --- | --- | --- |
| `USERNAME` | Username | `bc875284` |
| `HOST` | Address | `sftp.example.net` |
| `PORT` | Port | `2022` |
| Password | Password | Never paste it into a command |

The password is shown only right after you click **Change password**. If you do not have it, change it to get a new one (see [Turn on SFTP and get the password](/game-servers/files-and-sftp#turn-on-sftp-and-get-the-password)).

The top folder over SFTP (`/`) is the same folder the dashboard's **Files** page shows as `/`, so the steps below connect to `/`. On some servers the files are one level down, inside a `server/` folder. If that folder is the only thing you see once connected, open it, or add `server` to the end of the path you use below.

:::danger{title="Do not share the password"}

Anyone with these details can read, change or delete your server files. Do not include them in screenshots, public messages or commands you plan to share.

:::

Choose your operating system:

- [Windows 10 or 11](#windows-10-or-11)
- [Linux with a graphical file manager](#linux-with-a-graphical-file-manager-the-easiest-option)
- [Linux with a normal mount folder](#linux-with-sshfs-a-normal-mount-folder)

## Windows 10 or 11

Windows needs two free components to open an SFTP drive: **WinFsp** and **SSHFS-Win**. You only install them once.

### Step 1: install SSHFS-Win

The easiest way is `winget`, which comes with current Windows 10 and 11:

1. Open the **Start** menu.
2. Type `Terminal`.
3. Open **Terminal** or **Windows PowerShell**. You do not need to run it as administrator.
4. Paste this command and press <kbd>Enter</kbd>:

```powershell
winget install SSHFS-Win.SSHFS-Win
```

5. Accept any installer prompts and wait for it to finish.
6. Close every File Explorer window, then open it again.

If Windows says it cannot find `winget`, install the components by hand:

1. Download and run the latest [WinFsp](https://github.com/winfsp/winfsp/releases/latest) installer with its default options.
2. Download the latest [SSHFS-Win](https://github.com/winfsp/sshfs-win/releases/latest) installer. Choose the `x64` file on almost every current computer.
3. Install it with the default options.

:::tip{title="If the path is not recognized in the next step"}

Restart Windows after installing both components. Reopening File Explorer is usually enough, but a restart makes sure the WinFsp service is running.

:::

### Step 2: build the drive path

Windows does not use the `sftp://...` address shown in the dashboard here. It needs a special SSHFS-Win path:

```text
\\sshfs.r\USERNAME@HOST!PORT
```

Replace `USERNAME`, `HOST` and `PORT` with the values from the dashboard without changing any other characters. With the made-up details in the table, it would be:

```text
\\sshfs.r\bc875284@sftp.example.net!2022
```

Pay attention to these details:

- It starts with **two backslashes**: `\\`.
- There is `.r` after `sshfs`. The `r` makes the path start at the top folder (`/`).
- Use `!`, not `:`, between the host and the port.
- It ends with the port number, with no `/` or `\` after it. (If your files are inside a `server/` folder, add `\server` at the end.)
- Do not put the password in the path.

### Step 3: assign a drive letter

1. Open **File Explorer**.
2. Select **This PC** in the left sidebar.
3. Open the three-dot menu in the toolbar and select **Map network drive**. On some versions it is under the **Computer** tab.
4. Choose a free letter, such as `Z:`.
5. Paste the path you just built into **Folder**.
6. Tick **Reconnect at sign-in** if you want Windows to remember the drive.
7. Select **Finish**.
8. When Windows asks for credentials, enter the SFTP `USERNAME` and password from the dashboard. Do not use your email address or your Microsoft account password.
9. Tick **Remember my credentials** only on your own trusted computer.
10. Select **OK**.

The first connection can take a few seconds. The new drive then appears under **This PC**. Open it: you should see your server's folders and files, not an empty folder.

:::info{title="A red X does not always mean it is broken"}

If Windows starts before the internet connection is up, a remembered drive can show a red X. Double-click it once you are online; it usually reconnects. Enter the SFTP password again if asked.

:::

### Another way: connect the drive with a command

You can do the same from Terminal. Replace the letter and path with your own:

```powershell
net use Z: \\sshfs.r\USERNAME@HOST!PORT /persistent:yes
```

Windows asks for the password, so you do not have to put it in the command. `/persistent:yes` keeps the drive for later sign-ins.

### Disconnect the drive on Windows

First close every editor, terminal or window that uses files on the drive. Then right-click the drive under **This PC** and select **Disconnect**.

You can also disconnect it from Terminal:

```powershell
net use Z: /delete
```

This only removes the drive from your computer. It **does not delete the files on the server**.

## Linux with a graphical file manager: the easiest option

If you only want to drag files now and then, your file manager probably supports SFTP already and you do not need to install anything. The connection shows in the sidebar as a network location, but it does not give a normal folder path that every program can use.

### GNOME Files (Nautilus)

1. Open **Files**.
2. Select **Other Locations**.
3. Find **Connect to Server**.
4. Enter this address after replacing the three uppercase values:

```text
sftp://USERNAME@HOST:PORT/
```

5. Select **Connect**.
6. Enter the SFTP password when asked.
7. Save the password only if you trust this computer's user account and keyring.

### KDE Dolphin

1. Open **Dolphin**.
2. Press <kbd>Ctrl</kbd>+<kbd>L</kbd> to edit the location bar.
3. Paste the same `sftp://USERNAME@HOST:PORT/` address and press <kbd>Enter</kbd>.
4. Enter the username and password if Dolphin asks for them.
5. Right-click the sidebar and add the location to **Places** if you want a shortcut.

To disconnect, select the eject icon next to the location. Just closing the file manager window may leave the connection open. Disconnecting does not delete anything from the server.

## Linux with SSHFS: a normal mount folder

Use this method if you want the files in a normal folder, such as `/home/your-user/ServerFiles`, that any program can open.

### Step 1: install SSHFS

Open a terminal and install the package for your distribution:

**Ubuntu or Debian**

```bash
sudo apt update
sudo apt install sshfs
```

**Fedora**

```bash
sudo dnf install fuse-sshfs
```

**Arch Linux**

```bash
sudo pacman -S sshfs
```

If `sudo` asks for a password, it wants your **computer's** password, not the SFTP password.

### Step 2: create the folder where the files will appear

This command creates a folder named `ServerFiles` in your home folder:

```bash
mkdir -p "$HOME/ServerFiles"
```

You can choose another name, but then change `$HOME/ServerFiles` in every command below.

### Step 3: mount the server files

Paste the following command after replacing `USERNAME`, `HOST` and `PORT`. Keep the separate lines as shown; the `\` at the end of a line means the command continues:

```bash
sshfs USERNAME@HOST:/ "$HOME/ServerFiles" \
  -o port=PORT \
  -o reconnect,ServerAliveInterval=15,ServerAliveCountMax=3
```

The first connection may ask something like this:

```text
Are you sure you want to continue connecting (yes/no/[fingerprint])?
```

Type the whole word `yes` and press <kbd>Enter</kbd>. Then paste the SFTP password from the dashboard and press <kbd>Enter</kbd> again.

:::info{title="Nothing appears while you type a password"}

This is normal: the terminal shows no dots, stars or letters while you enter a password. Paste it once and press <kbd>Enter</kbd>.

:::

Now open the `ServerFiles` folder in your file manager. You can also check it from the terminal:

```bash
ls "$HOME/ServerFiles"
```

The `ServerAliveInterval` and `reconnect` options help notice a lost connection and reconnect. Even so, if your internet connection drops while a file is open, close the file and open it again once the connection is back.

### Unmount the folder on Linux

Do not delete the folder to disconnect. First close programs that use its files, then run:

```bash
fusermount3 -u "$HOME/ServerFiles"
```

If your distribution says `fusermount3` does not exist, use the older command name:

```bash
fusermount -u "$HOME/ServerFiles"
```

The local folder stays in place, empty and ready for the next mount. To reconnect after restarting your computer, run the `sshfs` command from step 3 again.

## Fix the most common problems

### `Connection timed out` or `Connection refused`

- Copy the **Address** and **Port** again from the **Data Volume** page.
- Check that the **SFTP file transfer** card shows **On**.
- Do not use the game port or any other port; only the SFTP port from the card works.
- Check that your computer is online and that a firewall or workplace network is not blocking that port.

### `Permission denied` or the password is asked again and again

- Copy the username and password again; they are case-sensitive.
- Make sure you use the SFTP details from **Data Volume**, not your dashboard login. If you changed the password, use the new one.
- If Windows saved an old password, open **Credential Manager → Windows Credentials**, remove the entry for the SFTP host and connect again.

### The drive is empty or does not show the expected files

The right remote path is `/`, the same top folder the dashboard's **Files** page shows.

- On Windows, check that the path starts with `\\sshfs.r\` and ends with the port.
- On Linux, check that the source in the command ends in `:/`.
- If all you see is a `server/` folder, your files are one level down: open it, or add `server` to the end of the path (`\server` on Windows, `:/server` on Linux).

### Windows cannot find the network name

- Check that WinFsp and SSHFS-Win are installed.
- Restart Windows once.
- Check the two `\` at the start, the `.r` and the `!` before the port.
- Do not paste an address starting with `sftp://` into **Map network drive**.

### Linux says `mountpoint is not empty`

Unmount any earlier connection before mounting again. Do not keep your own files inside `$HOME/ServerFiles`: they are hidden while SFTP is mounted and come back after it is unmounted.

### Linux says `target is busy` while unmounting

A program is still using the folder. Close editors and file manager windows, and make sure no terminal is inside the folder:

```bash
cd "$HOME"
fusermount3 -u "$HOME/ServerFiles"
```

### The drive freezes after the internet connection drops

Close the programs trying to use it, unmount or disconnect the drive, and connect it again. A save that was running when the network went down may have failed, so check that file before you carry on.

### `WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!`

Do not skip this warning or simply delete the saved key. First check that you copied the right **Address** from **Data Volume**. If the address is right and the warning stays, [contact our support](https://virenode.fi/gaming/support) before you enter your password. The server key may have changed for a good reason, but the warning is there to stop you from connecting to an impostor.

## Frequently asked questions

<details>
<summary>Do the files also take up space on my computer?</summary>

Not as a full copy. Programs read and write the data over the internet when they need it. Some programs may keep their own local cache or temporary files.

</details>

<details>
<summary>Can I work without an internet connection?</summary>

No. This is a remote drive, not a sync tool. To work offline, download a copy first and upload it again when you are done, taking care not to overwrite newer changes.

</details>

<details>
<summary>Does the game server have to be running?</summary>

No. SFTP works while the game server is stopped. In fact, you should stop the server before changing worlds, databases or many files at once.

</details>

<details>
<summary>Why is it slower than my normal drive?</summary>

Every action travels to the server over an encrypted connection. Opening a folder with thousands of small files can be much slower than opening a local folder. For a very large one-off transfer, an SFTP program such as WinSCP or FileZilla may be easier.

</details>

<details>
<summary>Does disconnecting or unmounting delete anything?</summary>

No. It only removes the shortcut from your computer. Deleting files *inside* the drive while it is connected does delete them from the server.

</details>
