# &#x20;Local Installation

This section provides step-by-step instructions to install and run LumoKit locally.

***

**🚨 Important: Installation Order**

The LumoKit frontend depends on a running LumoKit backend instance. Therefore, you **must install and start the backend first** before running the frontend.

**1. Backend Installation (`LumoKit` Backend)**

Follow these steps to set up the LumoKit backend:

1. **Clone the Repository:**
   * (The documentation provided does not specify the backend repository URL. Assuming you have access to it, clone it to your local machine.)
   * Example: `git clone https://github.com/Lumo-Labs-AI/lumo-frontend.git`
   * `cd lumokit`
2. **Ensure Pre-requisites:**
   * Verify Python 3.11+, PostgreSQL 13+, Makefile, Poetry, Docker, and Docker Compose are installed.
   * Ensure your PostgreSQL server is running.
3. **Environment Configuration:**
   * Copy the example environment file: `cp .env.example .env`
   * Edit the `.env` file with your specific configurations (Database details, API keys, Solana RPC URL, etc.) as detailed in the "Environment Configuration" page.
4. **Running the Application (using Docker and Make commands):**
   * **Ensure Docker is running on your system.**
   * **First-time setup** (builds containers and applies database migrations):Bash

     ```
     make build migrate
     ```
   * **To build the Docker containers** (if not the first time, or after changes):Bash

     ```
     make build
     ```
   * **To start the services:**&#x42;ash

     ```
     make up
     ```
   * **To check logs:**&#x42;ash

     ```
     make logs
     ```
   * **Convenience command to stop, rebuild, start, and view logs:**&#x42;ash

     ```
     make down build up logs
     ```
5. **Verify Backend Operation:**
   * Once the backend is running (`make up`), you can access the API documentation in your browser:
     * Swagger UI: `http://localhost/docs`
     * ReDoc: `http://localhost/redoc`
   * (Note: `http://localhost` implies the Docker setup maps the service to port 80 on your host, or you have a reverse proxy. Check `docker-compose.prod.yml` for exact port mappings if needed.)

***

**2. Frontend Installation (`lumokit-frontend`)**

Once the backend is running and accessible, proceed with the frontend installation:

1. **Clone the Repository:**

   Bash

   ```bash
   git clone https://github.com/Lumo-Labs-AI/lumokit-frontend.git
   ```
2. **Navigate to the Project Directory:**

   Bash

   ```bash
   cd lumokit-frontend
   ```
3. **Install Dependencies:**
   * Using `npm`:Bash

     ```bash
     npm install
     ```
   * Or using `yarn`:Bash

     ```bash
     yarn install
     ```
4. **Set up Environment Variables:**
   * Rename the `.env.example` file (located in the root of the `lumokit-frontend` project) to `.env.local`.
   * Update the variables within `.env.local`, ensuring `NEXT_PUBLIC_API_URL` points to your running backend (e.g., `http://localhost` if your backend is correctly mapped by Docker). Refer to the "Environment Configuration" page for details on all variables.
5. **Run the Development Server:**
   * Using `npm`:Bash

     ```bash
     npm run dev
     ```
   * Or using `yarn`:Bash

     ```bash
     yarn dev
     ```
6. **Access LumoKit Frontend:**
   * Open your browser and navigate to `http://localhost:3000` (or the port specified in your terminal, usually 3000 for Next.js applications).

***

{% hint style="success" %}
You should now have a locally running instance of LumoKit Frontend connected to your LumoKit Backend!
{% endhint %}


---

# 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://www.lumolabs.ai/lumokit-solana-ai-toolkit-framwork/installation-guide/local-installation.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.
