Local deployment
Describes how to run Opik locally using Docker Compose
Important: If you’re using or looking to use Opik or Comet enterprise version please reach out to Sales@comet.com to gain access to the correct deployment documentation.
To run Opik locally we recommend using Docker 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.
Before running the installation, make sure you have Docker and Docker Compose installed:
If you are using Mac or Windows, both docker
and docker compose
are included in the Docker
Desktop installation.
Installation
To install Opik, you will need to clone the Opik repository and run the following commands:
Linux / Mac
Windows
Opik will now be available at http://localhost:5173
In order to use the Opik Python SDK with your local Opik instance, you will need to run:
or in python:
This will create a ~/.opik.config
file that will store the URL of your local Opik instance.
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:
Linux / Mac
Windows
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:
Linux / Mac
Windows
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.
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:
Uninstalling Opik
To remove Opik, you will need to remove the Opik containers and volumes:
Removing the volumes will delete all the data stored in the Opik platform and cannot be recovered. We do not recommend this option unless you are sure that you will not need any of the data stored in the Opik platform.
Running a specific version of Opik
You can run a specific version of Opik by setting the OPIK_VERSION
environment
variable:
Building the Opik platform from source
You can also build the Opik platform from source by running the following command:
This will build the Frontend and Backend Docker images and start the Opik platform.