# Local deployment

> Configure your local Opik deployment using Docker Compose for quick setup. Ideal for testing but not for production environments.

> **Important:** If you're using or looking to use Opik or Comet enterprise version please reach out to [Sales@comet.com](mailto:Sales@comet.com) to gain access to the correct deployment documentation.

To run Opik locally we recommend using [Docker Compose](https://docs.docker.com/compose/). It's easy to setup and allows you to get started in a couple of minutes **but** is not meant for production deployments. If you would like to run Opik in a production environment, we recommend using our [Kubernetes Helm chart](/self-host/kubernetes).

Before running the installation, make sure you have Docker and Docker Compose installed:

* [Docker](https://docs.docker.com/get-docker/)
* [Docker Compose](https://docs.docker.com/compose/install/)

<Note>
  If you are using Mac or Windows, both `docker` and `docker compose` are included in the [Docker
  Desktop](https://docs.docker.com/desktop/) installation.
</Note>

## Installation

To install Opik, you will need to clone the Opik repository and run the following commands:

<Tabs>
  <Tab value="Linux / Mac" title="Linux / Mac">
    ```bash
    # Clone the Opik repository
    git clone https://github.com/comet-ml/opik.git

    # Navigate to the opik folder

    cd opik

    # Start the Opik platform

    ./opik.sh

    ```

    Opik will now be available at [http://localhost:5173](http://localhost:5173)
  </Tab>

  <Tab value="Windows" title="Windows">
    ```powershell
    # Clone the Opik repository
    git clone https://github.com/comet-ml/opik.git

    # Navigate to the opik folder
    cd opik

    # Start the Opik platform
    powershell -ExecutionPolicy ByPass -c ".\opik.ps1"
    ```

    Opik will now be available at [http://localhost:5173](http://localhost:5173)
  </Tab>
</Tabs>

<Tip>
  In order to use the Opik Python SDK with your local Opik instance, you will need to run:

  ```bash
  pip install opik

  opik configure --use_local
  ```

  or in python:

  ```python
  import opik

  opik.configure(use_local=True)
  ```

  This will create a `~/.opik.config` file that will store the URL of your local Opik instance.
</Tip>

All the data logged to the Opik platform will be stored in the `~/opik` directory, which means that you can start and stop the Opik platform without losing any data.

## Stopping the Opik platform

You can stop the Opik server by running the following commands:

<Tabs>
  <Tab value="Linux / Mac" title="Linux / Mac">
    ```bash
    # Ensure you are running this command for the root of the Opik repository you cloned
    ./opik.sh --stop
    ```
  </Tab>

  <Tab value="Windows" title="Windows">
    ```powershell
    # Ensure you are running this command for the root of the Opik repository you cloned
    powershell -ExecutionPolicy ByPass -c ".\opik.ps1 --stop"
    ```
  </Tab>
</Tabs>

**Note:** You can safely stop the Opik platform without losing any data.

## Upgrading and restarting the Opik platform

To upgrade or restart the Opik platform, you can simply run the `opik` script again:

<Tabs>
  <Tab value="Linux / Mac" title="Linux / Mac">
    ```bash
    # Ensure you are running this command for the root of the Opik repository you cloned
    ./opik.sh
    ```
  </Tab>

  <Tab value="Windows" title="Windows">
    ```powershell
    # Ensure you are running this command for the root of the Opik repository you cloned
    powershell -ExecutionPolicy ByPass -c ".\opik.ps1"
    ```
  </Tab>
</Tabs>

<Tip>
  Since the Docker Compose deployment is using mounted volumes, your data will ***not*** be lost when you upgrade Opik.
  You can also safely start and stop the Opik platform without losing any data.
</Tip>

## Advanced configuration - Docker compose

Using Docker Compose directly instead of using the `opik.sh` or `opik.ps1`
scripts provides you with some additional options.

### Starting Opik with Docker Compose

Instead of using the `opik.sh` or `opik.ps1` scripts, you can also run the
`docker compose` command directly with service profiles:

```bash