# Setup

ExpanDrive Server edition is configured through a locally hosted web server running at `http://localhost:28080`.

## Linux

ExpanDrive Server edition installs to `/opt/local/bin/exfs` and is generally already in the user's path. Start the built-in web server by running:

`exfs --config`

If you are connecting remotely to a headless instance, connect via SSH port forwarding:

`ssh -L 28080:127.0.0.1:28080 yourserver.com`

## Windows

The MSI installer registers and starts the ExpanDrive Server Edition Windows service automatically. No manual service start is required. Once installation completes, the web configuration UI is available at `http://localhost:28080`. If you are accessing it remotely, connect via RDP or use SSH port forwarding.

### License Activation

Windows Server Edition uses a server token for activation. To get your server token, log into the ExpanDrive web management console and open the Server Edition page.

To activate using the web management console, enter your server token at `http://localhost:28080/license`, and activate the license.

For headless or scripted activation at the command line:

```
exfs.exe --register <server_token>
```

Once activated, the license refreshes automatically every hour. The server can remain offline for up to approximately 47 hours after the last successful check-in before the license is considered expired.

#### Moving an Installation to a Different Machine

Your server token is tied to your account and is used only for the first activation of a new server instance.

After activation, the server uses a separate key for ongoing license check-ins for that specific machine. To move an installation to a different machine, deactivate the old instance in the web management console and activate the new one with your server token.

#### Regenerating Your Server Token

To invalidate your existing server token, regenerate it in the [web management console](/web-management-console.md). Regenerating the token does not affect currently active server instances, but activating new instances requires the new token.

## Remote Configuration

ExpanDrive Server edition only listens on `localhost`, as it is not designed as a hardened service exposed to the public internet.

Cloud storage providers including Google, Dropbox, Box, and Microsoft all require the OAuth flow to have a well-known redirect URL to land on with an authorization code at the end of the flow. Since `localhost` is the only well-known URL each machine shares, the redirect must land there. Use SSH port forwarding to redirect to your local machine and have the result captured by ExpanDrive running on your server:

`ssh -L 28080:127.0.0.1:28080 yourserver.com`

## Drive Setup and Configuration

Add each connection as a Drive within the local web interface at `http://localhost:28080`.

Choose the type of provider and then authenticate. For providers that perform OAuth authentication, use SSH port forwarding to redirect to your local machine and have the result captured by ExpanDrive running on your server.

### Additional Drive Options for Windows

On Windows, ExpanDrive Server Edition offers a few extra configuration options.

#### Mount Type

Your mount type can be a network drive (default), or a removable disk (appears as a removable storage device). Without a specific reason to change this, leave it as a network drive for the best performance.

#### No Drive Letter

You can choose not to mount the drive using a drive letter, and instead have it accessible only via UNC. Access the storage by browsing to `\\computername`.

#### Share on Network

On Windows, ExpanDrive Server Edition can automatically share your mount on the network, so other computers can connect to your machine and access the storage.

All connecting computers share the same credentials you configured the drive for, so this isn't always optimal for a multi-user or multi-tenant setup.

For Citrix or Terminal Services environments, use the regular installer that installs for all users, which gives each user their own isolated process and drive mappings.

Configuration for the group is easier to manage through the [Web Management Console](/web-management-console.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.expandrive.com/expandrive-server-edition/setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
