> For the complete documentation index, see [llms.txt](https://docs.valospectra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.valospectra.com/self-hosting-spectra.md).

# Self-Hosting Spectra

This guide will assume you're using Spectra in a local environment. If you're intending on deploying Spectra to a server, however, the process will be very similar and only differ in some URLs and individual networking setups, which are difficult to cover.

### Note:

There are some aspects of Spectra that you won't be able to self-host, such as the backends of the mapbans and the playercam components (although these can still be changed in the frontend).

{% tabs %}
{% tab title="Docker" %}

#### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* [Docker](https://www.docker.com/)

#### Setting up the directory structure <a href="#setting-up-the-directory-structure" id="setting-up-the-directory-structure"></a>

Create a directory in which Spectra will be running. In this directory, create a directory called `keys` and a directory called `config`.

It should look like this:

```
.
├── docker-compose.yml
├── config
│   └── config.json
└── keys
```

#### Example Docker compose file <a href="#example-docker-compose-file" id="example-docker-compose-file"></a>

Inside the root directory you want to use for Spectra, create a file named `docker-compose.yml` with the following contents:

```yaml
---
services:
  server:
    image: "ghcr.io/valospectra/server:latest"
    ports:
      - "5100:5100"
      - "5101:5101"
      - "5200:5200"
    environment:
      INSECURE: true
      REQUIRE_AUTH_KEY: false
    volumes:
      - ./keys:/app/keys
  frontend:
    image: "ghcr.io/valospectra/overlay:latest"
    ports:
      - "3000:80"
    volumes:
      - ./config:/usr/share/nginx/html/assets/config/
```

For possible environment variables for use, see [Possible Environment Variables](https://docs.projectchaos.ch/docs/documentation/valorant-overlay/spectra-self-hosting/#possible-environment-variables)

#### Configuration file <a href="#configuration-file" id="configuration-file"></a>

In order to configure some values for use in the Spectra-Frontend, create a file named `config.json` inside the `config` directory.

An example of the config can be found here: <https://github.com/ValoSpectra/Spectra-Frontend/blob/main/public/assets/config/config.json>

### Possible Environment Variables <a href="#possible-environment-variables" id="possible-environment-variables"></a>

#### Server <a href="#server" id="server"></a>

| Environment Variable | Description                                                                                                          | Possible Values | Default Value        |
| -------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------- | -------------------- |
| INSECURE             | This option determines if the Spectra-Server is going to use HTTPS with the provided SSL certificates.               | true/false      | false                |
| SERVER\_KEY          | The path inside the Docker container to use as the SSL key file.                                                     |                 | /app/keys/server.key |
| SERVER\_CERT         | The path inside the Docker container to use as the SSL certificate file.                                             |                 | /app/keys/server.crt |
| REQUIRE\_AUTH\_KEY   | If you're self-hosting your server, you might not want it to require using a Key. In this case, set this to `false`. | true/false      | true                 |
| USE\_BACKEND         | TBD                                                                                                                  |                 |                      |
| {% endtab %}         |                                                                                                                      |                 |                      |
| {% endtabs %}        |                                                                                                                      |                 |                      |

### Connecting to your Self-Hosted Spectra Instance

After successfully setting up a Spectra instance, you can connect to it using the normal Spectra client. The only change required is that the "Server IP" needs to be set to your own Server.&#x20;

If you hosted Spectra locally, this would be `http://localhost:5100`.&#x20;

{% hint style="info" %}
If you have a Certificate configured, you can remove the http\:// as you'll have the connection encrypted.
{% endhint %}

Please note your authentication settings above to make sure everything else is configured as required. If you used the docker-compose file above, the Key field does not matter (still a required field, so just type in anything you like) as the `REQUIRE_AUTH_KEY` variable is set to `FALSE`.


---

# 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:

```
GET https://docs.valospectra.com/self-hosting-spectra.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.
