# Installation

> Install MTConnect Server on Windows as a Windows Service, sign in to the App, and upgrade or uninstall it.

URL: https://www.trakhound.com/docs/mtconnect-server/installation

The MTConnect Server installer sets up a TrakHound Instance as a Windows Service, with MTConnect Server installed and configured. This page covers installing, signing in, upgrading, and uninstalling. Once it's installed, follow the [Quick Start](https://www.trakhound.com/docs/mtconnect-server/quick-start).

## Requirements

| Requirement | Details |
| --- | --- |
| **Windows (x64)** | Setup must be run as an Administrator. |
| **ASP.NET Core Runtime 10 (x64)** | Download it from [dotnet.microsoft.com](https://dotnet.microsoft.com/download/dotnet/10.0). Setup checks for it and offers to open the download page if it's missing. |
| **A database** (optional) | For Collection's Tables. SQLite needs no setup. A PostgreSQL or SQL Server database must already exist, and its user must be able to create tables in it (and schemas in PostgreSQL). |
| **An MQTT broker** (optional) | For Collection's Messages. Any MQTT broker, such as Mosquitto. |
| **A Collection License** (for Collection) | Request a free 2-hour trial from the App after installing, or buy a subscription. See [Collection Licenses](https://www.trakhound.com/docs/mtconnect-server/licenses). |

> The Agent Hub and the Tools don't need a database, a broker, or a License, so they only need Windows and the runtime.

## Install

[Download the installer](https://applications.trakhound.com/TrakHound.MTConnectServer/latest/download?prerelease=true&source=website) (`TrakHound-MTConnectServer-<version>-install.exe`), run it as an Administrator, and follow the wizard:

1. **Install Location** - The default is `C:\Program Files\TrakHound\MTConnectServer`. The configuration, data, and logs are also kept in this directory.
2. **TrakHound Instance** - The **HTTP Port** the App and API are served on (default `8490`).
3. **Admin Account** - The **Username** (default `admin`) and **Password** you'll sign in to the App with.
4. **Additional Tasks** - Create a Start Menu icon (on), create a Desktop icon (off), start the Service automatically on startup (on), and start the Service now (on).

MTConnect Server runs as the Windows Service **TrakHound MTConnect Server** (`TrakHound-MTConnectServer`). It's separate from the `TrakHound-Instance` Service, so both can be installed on the same computer. When **Start the Service now** is checked, Setup waits for the Service to start and shows an error if it doesn't (see [Troubleshooting](https://www.trakhound.com/docs/mtconnect-server/troubleshooting)).

The installer doesn't ask for a database, an MQTT broker, or a License. They're added in the App's [Quick Start](https://www.trakhound.com/docs/mtconnect-server/quick-start) after installing.

## Open the App

Open **TrakHound MTConnect Server** from the Start Menu, or go to `http://localhost:8490/` (with the HTTP Port entered during install), and sign in with the Admin Account.

To open the App from another computer, use this computer's name or IP address, and allow the port through the Windows Firewall. The Agent Hub's port (default `5001`) also needs to be allowed for MTConnect clients on other computers.

| Address | What It Serves | Sign In |
| --- | --- | --- |
| `http://{server}:8490/` | The MTConnect Server App | The Admin Account |
| `http://{server}:8490/api` | The [REST API](https://www.trakhound.com/docs/mtconnect-server/api) | An API Key (or the App's sign in) |
| `http://{server}:5001/` | The [Agent Hub](https://www.trakhound.com/docs/mtconnect-server/agent-hub)'s MTConnect endpoints | None, since MTConnect clients don't sign in |

The App's header shows the installed version and the status of the Collection and Agent Hub Workers. **Running** means they started. Hover over the status to see each Worker's status. To change the Admin Account's password, see [Administration](https://www.trakhound.com/docs/mtconnect-server/administration#admin-account).

## Silent Install

To install without the wizard (ex. to deploy to several computers), run the installer from an Administrator command prompt:

```
TrakHound-MTConnectServer-<version>-install.exe /VERYSILENT /ADMINUSERNAME=admin /ADMINPASSWORD=<password> /COLLECTIONLICENSE=048FS-1J3JD-...
```

| Parameter | Description |
| --- | --- |
| `/ADMINUSERNAME=`, `/ADMINPASSWORD=` | The Admin Account. |
| `/COLLECTIONLICENSE=` | (optional) A Collection License Code, added before the Service starts. License Codes are issued for a specific computer, so request it for the computer being installed on. Works for a new install and an upgrade. |

A silent install uses the default HTTP Port. A database or a broker is added afterwards in the App, the same as with the wizard.

## Upgrade

Run the installer for the new version. Setup stops the Service, replaces MTConnect Server, and starts it again. The existing configuration (Devices, Groups, Profiles, Services, Licenses, and the HTTP Port) is kept, so the configuration pages are skipped.

- The App, Api, and sign in configurations are replaced, since each version can need changes, so edits to them don't survive an upgrade.
- When a newer version is available, the App's header shows **Update** next to the installed version. Click it to download the installer (see [Updates](https://www.trakhound.com/docs/mtconnect-server/administration#updates)).

## Uninstall

Uninstall **TrakHound MTConnect Server** from **Settings > Apps** (or **Add or Remove Programs**). The Service and the installed files are removed. The configuration, data, and logs are left in the install directory. Delete the directory to remove them.

## Install on an Existing TrakHound Instance

MTConnect Server is a set of [TrakHound Packages](https://www.trakhound.com/docs/trakhound-framework/packages): the App, the Api, the Collection Worker, and the Agent Hub Worker. To add MTConnect Server to a [TrakHound Instance](https://www.trakhound.com/docs/trakhound-framework/instances) you already run, install the Packages on it instead of using the installer. Collection and the Agent Hub are independent, so either Worker can be installed on its own.

|  | Installer | Packages |
| --- | --- | --- |
| **Contents** | A TrakHound Instance with MTConnect Server installed and configured, running as a Windows Service | The MTConnect Server Packages |
| **Use when** | Installing MTConnect Server as a standalone application | Adding MTConnect Server (or only Collection or the Agent Hub) to an existing Instance |
| **App and Api routes** | `/` and `/api` | `/mtconnect-server` and `/api/mtconnect-server` |
| **API security** | API Keys from the App | The Instance's [Security Profiles](https://www.trakhound.com/docs/trakhound-framework/security) |
