> For the complete documentation index, see [llms.txt](https://docs.kiloiot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kiloiot.io/kilo-docs-es/kilo-center/kilo-mioty-service-center/getting-started/installation-linux-host.md).

# Instalación: host Linux

Instala KiloCenter en un host Linux sin Docker — PostgreSQL, Redis, Mosquitto, certificados TLS y los cuatro servicios KC.

### Objetivo

Ejecute KiloCenter sin Docker instalando todas las dependencias directamente en el host.

### Paso 1: Instalar dependencias de infraestructura

Instale e inicie estos servicios en el host:

* **PostgreSQL 18+** -- cree una base de datos llamada `kilocenter`
* **Redis 7+**
* **Mosquitto 2.0+**

### Paso 2: Generar certificados TLS

Compile el generador de certificados y genere los certificados antes de configurar o iniciar KC-Core:

```bash
cd kilocenter-modules
go build -o KC-Core/certgen KC-Core/cmd/certgen/main.go
KC-Core/certgen -dir KC-Core/certificates -days 365 -server your-hostname.example.com
```

Reemplaza `your-hostname.example.com` con el FQDN o la dirección IP que las estaciones base usarán para acceder a este servidor. Para pruebas solo locales, use `localhost`.

Esto crea cuatro archivos en `KC-Core/certificates/`:

* `ca.crt` y `ca.key` -- certificado de CA y clave privada
* `server.crt` y `server.key` -- certificado del servidor y clave privada

El certificado del servidor incluye automáticamente `localhost`, `127.0.0.1`, y todas las IP locales de la red como SAN.

KC-Core no podrá iniciarse sin estos archivos. Para renovarlos más tarde sin regenerar la CA, use `-server-only`:

```bash
KC-Core/certgen -dir KC-Core/certificates -days 365 -server your-hostname.example.com -server-only
```

Consulte Seguridad para obtener la referencia completa de certgen y la generación de certificados de cliente.

### Paso 3: Configurar KC-Core

Actualice `kilocenter-modules/KC-Core/config.yaml` para que coincida con las direcciones de los servicios de su host. Configuraciones clave:

* `storage.host` y `storage.port` -- dirección de PostgreSQL (normalmente `localhost:5432` para instalación en host)
* `storage.username` y `storage.password` -- credenciales de la base de datos
* Rutas de los certificados TLS de BSSCI y SCACI

### Paso 4: Compilar e iniciar KC-Core

Desde `kilocenter-modules/KC-Core/`:

```bash
go build -o kilocenter ./cmd/kilocenter/
./kilocenter -config config.yaml
```

### Paso 5: Compilar e iniciar KC-Gateway

Desde `kilocenter-modules/KC-Gateway/`:

```bash
go build -o gateway ./cmd/gateway/
./gateway -config config.yaml
```

### Paso 6: Iniciar KC-Web

Desde `kilocenter-modules/KC-Web/`:

```bash
bun install
bun run dev
```

### Paso 7: Validar

* Salud de KC-Core: <http://localhost:8086/health>
* Estado de KC-Gateway: <http://localhost:8087/health>
* KC-Web: <http://localhost:5173>


---

# 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.kiloiot.io/kilo-docs-es/kilo-center/kilo-mioty-service-center/getting-started/installation-linux-host.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.
