# Setup and Installation

## Requirements

Server and Client requirements: <https://docs.linuxcontrolcenter.com.br/requirements>\
Community License requested at: <https://start.linuxcontrolcenter.com.br>

* The **Community License** is free and includes all features enabled, with a limitation of managing up to **25 hosts**.

For organizations that require support for a larger number of devices, we recommend purchasing the **Enterprise License**. Contact us at <https://linuxcontrolcenter.com.br/contato/> for more information and to learn how to scale your operations efficiently.

## Overview

The installation of the Linux Control Center is done via a Bash script. The entire installation process is automated, requiring only the configuration of a few variables.

## Purpose

This manual aims to demonstrate the step-by-step process of installing the LCC using the installation script.

## LCC Installation

### Installation Script

{% hint style="warning" %}
**Note:** It is not necessary to manually install any software dependencies. The LCC installation script automatically installs all required dependencies.
{% endhint %}

1. Copy the script below by clicking the **Copy** button.

```
#!/bin/bash
address=""
db_name=""
db_user=""
db_pass=""
redis_pass=""
license_uuid=""
license_password=""
tag_version="stable"

#download lcc-cli

rm -rf lcc-cli-*.tar.gz 2> /dev/null

wget https://download.linuxcontrolcenter.com.br/repository/public/lcc-cli-stable.tar.gz

# untar lcc-cli
tar -xzvf lcc-cli-stable.tar.gz

# make /opt/lcc/bin directory
mkdir -p /opt/lcc/{bin,etc}

# move lcc-cli to /opt/lcc/bin
mv lcc-cli-stable /opt/lcc/bin/lcc-cli

# make lcc-cli executable
chmod +x /opt/lcc/bin/lcc-cli

rm -rf /usr/local/bin/lcc-cli 2> /dev/null

ln -s /opt/lcc/bin/lcc-cli /usr/local/bin/lcc-cli

cat > /opt/lcc/etc/database.yml <<EOF
db_name: ${db_name}
db_user: ${db_user}
db_pass: ${db_pass}

EOF

cat > /opt/lcc/etc/console.yml <<EOF
balancer_url: https://${address}
site_url: https://${address}
node_url: https://${address}
node_sequence: 1
db_name: ${db_name}
db_user: ${db_user}
db_pass: ${db_pass}
db_host: ${address}
db_port: 5432
threads: 10
redis_pass: ${redis_pass}

EOF

cat > /opt/lcc/etc/worker.yml <<EOF
console_url: https://${address}
console_uuid_server: ${license_uuid}
node_url: https://127.0.0.1
work_threads: 10
self_threads: 3

EOF

cat > /opt/lcc/etc/alert_report.yml <<EOF
db_name: ${db_name}
db_user: ${db_user}
db_pass: ${db_pass}
db_host: ${address}
db_port: 5432
redis_pass: ${redis_pass}
threads: 3

EOF

cat > /opt/lcc/etc/license.yml <<EOF
license_uuid: ${license_uuid}
license_password: ${license_password}

EOF

cat > /opt/lcc/etc/version.yml <<EOF
tag_version: $tag_version

EOF

lcc-cli database --install
lcc-cli console --install
lcc-cli worker --install
lcc-cli alert-report --install

exit 0
```

### Script Configuration

1. Access the host where LCC will be installed using the **root** user in the terminal.
2. Create a file with a **.sh** extension and paste the script content.

   Example: `nano script-install.sh`
3. Configure the variables as described below:
   * **address=" "** → Domain (FQDN) or IPv4 address of the host used to access the Console.<br>
   * **db\_name="lcc"** → Keep the default database name for easier management.<br>
   * **db\_user=" "** → Enter a username for the database.<br>
   * **db\_pass=" "** → Enter a password for the database.<br>
   * **redis\_pass=" "** → Enter a password for Redis.<br>
   * **license\_uuid=" "** → Enter the license UUID.<br>
   * **license\_password=" "** → Enter the license password.<br>
   * **tag\_version="stable"** → Keep the **stable** tag to install the latest stable version of LCC.<br>
4. See the example in the image below:

   ![](/files/mOoGmB7sxiC3ysA49H4k)
5. Save the script changes:

* Keyboard shortcut to save (nano): `ctrl + o`
* Keyboard shortcut to exit (nano): `ctrl + x`

### Script Permissions and Execution

1. Add execute permission to the script with the command:

   Command: `chmod +x script-install.sh`

   ![](/files/YcTUp8cP0PyxGOn47Azc)
2. Em seguida, execute o script e escolha o idioma digitando o número correspondente para leitura da EULA.

   Command: `./script-install.sh`

   ![](/files/h4tEcB7Y49vMMLuoDraX)
3. Read the EULA and agree by pressing Enter.
4. Confirm acceptance of the EULA by typing yes and pressing Enter, then type y to start the LCC installation.

   ![](/files/jSF7Pm4rL9o4dhtV7rDy)
5. The terminal will become available once the installation is complete.

   ![](/files/flRoselN0qjANYiBvTnW)

### First Login to LCC

1. Access the LCC URL in the following format:

   https\:// ip-address ou Hostname/console/
2. Enter the default credentials and click LOG IN:

   * *Username: 7dev*
   * *Password: 7dev*

   ![](/files/4fKyNRVloAWyanzDg97J)
3. Accept the Terms of Use and log in.

   ![](/files/HJ2QULqvaDRWeY7Mz8eT)

### Establishing Trust Between Console and Worker

1. Right after installation, it is necessary to establish trust between the Console and the Worker to enable the execution of Actions.
2. Click on **Config**.

   ![](/files/cgxhZBH2mCNVMGp10bft)
3. Click on **Worker**.

   ![](/files/Dydh5Qtimhwu0pGpnxeu)
4. Click on **Actions**, then click **Trust**.

   ![](/files/BpT6FUsP8skVlo63BmSR)
5. The status will change to **Accepted**, indicating that the LCC is ready for use!

   ![](/files/KzmI3aoQrvDcNpslL8Rg)


---

# 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.linuxcontrolcenter.com.br/en/setup-install.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.
