> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evidentlyai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Self-hosting

> How to self-host the open-source Evidently UI service.

<Note>
  Evidently Cloud is no longer available as a SaaS product, but you can self-host the open-source Evidently Platform (as described on this page), or use the Evidently library with other tools.
</Note>

In addition to using Evidently Python library, you can self-host the UI Service to get a monitoring Dashboard and organize the results of your evaluations. This is optional: you can also view evaluation results in Python or export to JSON or HTML.

To get a self-hostable Dashboard, you must:

* Create a Workspace (local or remote) to store your data.
* Launch the UI service.

## 1. Create a Workspace

Once you [install Evidently](/docs/setup/installation), you will need to create a `workspace`. This designates a remote or local directory where you will store the evaluation results (JSON Reports called `snapshots`), traces or datasets. The UI Service will read the data from this source.

As a storage backend, Evidently supports:

* a file system
* any SQL-like database (such as SQLite or Postgres)
* any S3-compatible storage (such as Amazon S3, GCS, or MinIO – through `fsspec`).

There are three scenarios, based on where you run the UI Service and store data.

* **Local Workspace**. Both the UI Service and data storage are local.
* **Remote Workspace**. Both the UI Service and data storage are remote.
* **Workspace with remote data storage**. Run the UI Service and store data on different servers.

### Local Workspace

Here, you generate, store the snapshots and run the monitoring UI on the same machine.

Imports:

```python theme={null}
from evidently.ui.workspace import Workspace
from evidently.ui.workspace import WorkspaceBase
```

To create a local Workspace and assign a name:

```python theme={null}
ws = Workspace.create("evidently_ui_workspace")
```

You can pass a `path` parameter to specify the path to a local directory.

### Remote Workspace

<Info>
  **Code example (Docker)**. See the [remote service example](https://github.com/evidentlyai/evidently/tree/main/examples/service).
</Info>

In this scenario, you send the snapshots to a remote server. You must run the Monitoring UI on the same remote server. It will directly interface with the filesystem where the snapshots are stored.

Imports:

```python theme={null}
from evidently.ui.remote import RemoteWorkspace
from evidently.ui.workspace import Workspace
from evidently.ui.workspace import WorkspaceBase
```

To create a remote Workspace (UI should be running at this address):

```python theme={null}
workspace = RemoteWorkspace("http://localhost:8000")
```

You can pass the following parameters:

| Parameter                  | Description                                                                                  |
| -------------------------- | -------------------------------------------------------------------------------------------- |
| `self.base_url = base_url` | URL for the remote UI service.                                                               |
| `self.secret = secret`     | String with secret, None by default. Use it if access to the URL is protected by a password. |

### Remote snapshot storage

In the examples above, you store the snapshots and run the UI on the same server. Alternatively, you can store snapshots in a remote data store (such as an S3 bucket). The Monitoring UI service will interface with the designated data store to read the snapshot data.

To connect to data stores Evidently uses `fsspec` that allows accessing data on remote file systems via a standard Python interface.

You can verify supported data stores in the Fsspec documentation ([built-in implementations](https://filesystem-spec.readthedocs.io/en/latest/api.html#built-in-implementations) and [other implementations](https://filesystem-spec.readthedocs.io/en/latest/api.html#other-known-implementations)).

For example, to read snapshots from an S3 bucket (with MinIO running on localhost:9000), you must specify environment variables:

```text theme={null}
FSSPEC_S3_ENDPOINT_URL=http://localhost:9000/
FSSPEC_S3_KEY=my_key FSSPEC_S3_SECRET=my_secret
evidently ui --workspace s3://my_bucket/workspace
```

### \[DANGER] Delete Workspace

To delete a Workspace, run the command from the Terminal:

```bash theme={null}
cd src/evidently/ui/
rm -r workspace
```

<Warning>
  **You are deleting all the data**. This command will delete all the data stored in the workspace folder. To maintain access to the generated Reports, you must store them elsewhere.
</Warning>

## 2. Launch the UI service

To launch the Evidently UI service, you must run a command in the Terminal.

**Option 1**. If you log snapshots to a local Workspace directory, you run Evidently UI over it. Run the following command from the directory where the Workspace folder is located.

```bash theme={null}
evidently ui
```

**Option 2**. If you have your Project in a different Workspace, specify the path:

```bash theme={null}
evidently ui --workspace . /workspace
```

**Option 3**. If you have your Project in a specified Workspace and run the UI service at the specific port (if the default port 8000 is occupied).

```bash theme={null}
evidently ui --workspace ./workspace --port 8080
```

To view the Evidently interface, go to URL [http://localhost:8000](http://localhost:8000) or a specified port in your web browser.

### Demo projects

To launch the Evidently service with the demo projects, run:

```text theme={null}
evidently ui --demo-projects all
```

## Tutorials

1. Check this tutorial for a simple end-to-end example:

<Card title="Evidently UI tutorial" icon="laptop-code" href="https://github.com/evidentlyai/evidently/blob/main/examples/service/workspace_tutorial.ipynb">
  How to create a workspace, project and run Reports.
</Card>

2. Check this extended tutorial that shows LLM judge evaluation over collected traces and prompt optimization using a local workspace. There is also a [video walkthrough](https://youtu.be/Gem8TG6wNhU).

<Card title="Evidently UI tutorial" icon="laptop-code" href="https://github.com/evidentlyai/community-examples/blob/main/tutorials/local_content_generation.ipynb">
  LLM evaluation for tweet generation using local workspace.
</Card>
