> For the complete documentation index, see [llms.txt](https://docs.fiammalabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fiammalabs.io/our-product-suite/pragmatically-trustless-bitvm-bitcoin-bridge/user-guides/mainnet/fiamma-operator/1.-install-operator/1.-prepare-the-environment.md).

# 1. Prepare the environment

1. **Clone the Repository**

Clone the repository to your local machine:

```
git clone https://github.com/fiamma-chain/operator_for_linux.git
cd operator_for_linux
```

***

2. **Prepare the Environment**

Run the setup script to install all dependencies and prepare your environment:

```
./setup.sh
```

**Important:** After the first execution of `setup.sh`, you need to enable the Rust environment variables:

```
source "$HOME/.cargo/env"
```

Alternatively, you can restart your terminal or run:

```
source ~/.bashrc
# or if you're using zsh:
source ~/.zshrc
```

**This script will:**

* Install required packages (build-essential, gcc, g++, libssl-dev)
* Install and configure PostgreSQL
* Install Docker and Docker Compose (if not already installed)
* Install Rust and SQLx CLI
* Create a default .env file from .env\_example
* Start database and Redis containers
* Set **execute permissions** on scripts

***

3. **Database Setup**

Run database migrations to set up the required database schema:

```
cd dal && cp .env.example .env && sqlx migrate run && cd ..
```
