> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/connect-v2.1-en/administradores/windows_configuracion_servicios.md).

# Services and environment variables in Windows

On installations on Windows environments, Editran Connect uses a series of system services and environment variables for its correct execution and configuration. This section describes the involved services, the recommended startup order, and the system variables necessary for the environment to function.

> ⚠️ *Important:* All services and variables must initially run under the context of the user `LocalSystem`.

***

## Windows Services

![windows services](https://64653979-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvdpBggYaSLH9X3nOAiMG%2Fuploads%2Fgit-blob-01f2e1dce3cdaa95092ef137cd09df387b67ce9a%2F01_servicios_windows.png?alt=media)

The following services are part of the Editran Connect architecture. It is essential to respect the startup order to ensure that dependent modules find their resources available:

| Order | Service name                | Description                              | Initial state |
| ----- | --------------------------- | ---------------------------------------- | ------------- |
| 1     | **Editran License Service** | Handles requests from the License V2 API | Running       |
| 2     | **Editran Base Service**    | EDITRAN protocol for file transmission   | Running       |
| 3     | **Editran Connect Data**    | Database service for Editran Connect     | Running       |
| 4     | **Editran Connect Base**    | Base services of Editran Connect         | Running       |
| 5     | **Editran Connect Sign**    | Signing services for Editran Connect     | Running       |
| 6     | **Editran Connect Server**  | Web server for Editran Connect           | Running       |

> ℹ️ *Note:* If any of the services do not start, check that the environment variables are correctly configured and that there are no port conflicts.

***

## System environment variables

The following are the required environment variables, visible in the Windows registry under the path:\
`HKEY_USERS\.DEFAULT\Environment`

| Variable name                        | Value               | Description                                                   |
| ------------------------------------ | ------------------- | ------------------------------------------------------------- |
| `EDITRAN_DDBB_HOST`                  | `localhost`         | Database host address                                         |
| `EDITRAN_DDBB_PORT`                  | `5432`              | Database connection port                                      |
| `EDITRAN_DDBB_PWD`                   | `database_password` | Database user password                                        |
| `EDITRAN_DDBB_USER`                  | `database_user`     | Database connection user                                      |
| `EDITRAN_LOG_LEVEL`                  | `INFO`              | Overall system log level                                      |
| `EDITRAN_PORT_CONNECT`               | `8081`              | Main Connect service port                                     |
| `EDITRAN_PORT_SIGN`                  | `8085`              | Electronic signature service port                             |
| `EDITRAN_TASK_CONTROLLER_SIZE_QUEUE` | `500`               | Processing queue size of the scheduler                        |
| `EDITRAN_TASK_CONTROLLER_THREADS`    | `1`                 | Number of threads assigned to the scheduler's task controller |

> 🔒 *Security:* The database password must be kept protected. It is recommended to use encryption tools or store it in secure files if the configuration is externalized.

***

## Changing the owner of services and environment variables

By default, Editran Connect services are installed under the system account `LocalSystem`. However, in production environments or when access to network resources is required, it is recommended to run the services with a specific user account.

### Why change the owner?

Running the services with a user other than `LocalSystem` allows:

* Accessing shared network resources (for example, shared folders or remote databases).
* Improving traceability of accesses and logs.
* Controlling permissions more finely through security policies.

> ⚠️ *Important:* If the owner of the services is changed, the **environment variables** must also be configured in the same user for Editran Connect to function correctly.

***

### Steps to change the owner of the services

1. Open the Services panel:\
   `services.msc`
2. Locate each Editran Connect service (see services table).
3. Right-click the service and select:\
   `Properties`.
4. Go to the **Log On**.
5. tab,\
   `Select the option:`This account `, and enter the desired user (for example:`).
6. DOMAIN\editran\_user
7. Enter and confirm the user's password.
8. Repeat the process for all Editran services.

***

### Restart the services once the changes are applied.

Environment variables of the new user

* Once the user owner of the services is defined, the environment variables must be moved or defined in their context:`Access the registry editor (`regedit
  * `) or the graphical environment variables:`\
    or
  * `HKEY_USERS\[USER_SID]\Environment`
* Control Panel > System > Advanced system settings > Environment Variables

> Create (or copy) the necessary variables according to the configuration table. *🛠️* Technical tip: `Use a PowerShell script or` .reg

***

> ℹ️ *Note:* if you need to replicate the environment variables across multiple environments or servers.
>
> * If services continue to fail after changing the user, make sure that:
> * The new user has read/write permissions where necessary.
> * There are no port conflicts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.editran.onesait.com/documentacion-editran/connect-v2.1-en/administradores/windows_configuracion_servicios.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
