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

# Deploying Prisme.ai with Docker

> Detailed guide for deploying and managing Prisme.ai locally or on-premise using Docker and docker-compose.

Docker provides an effective solution for deploying Prisme.ai in local or on-premise environments. This guide covers everything you need to quickly deploy and manage Prisme.ai using Docker Compose.

***

## Prerequisites

Ensure your system meets the following prerequisites:

* **Docker (version 20.10+)** and **Docker Compose** installed.
* Minimum hardware: **4 vCPU, 16 GB RAM, 50 GB disk** space recommended.
* **Git** installed for cloning the repository.
* DNS setup: Local wildcard DNS (`*.pages.local.prisme.ai`) pointed to Docker host machine.

***

## Docker Environment Setup

Follow these steps to set up your local Docker environment for Prisme.ai:

<Steps>
  <Step title="Clone Repository">
    Clone the Prisme.ai repository from GitLab:

    ```bash theme={null}
    git clone https://gitlab.com/prisme.ai/prisme.ai.git
    cd prisme.ai
    ```
  </Step>

  <Step title="Configure Environment Variables">
    Edit the `.env` file at the root of the project to configure your Docker environment:

    Example `.env` configuration:

    ```env theme={null}
    PAGES_HOST=.pages.local.prisme.ai:3100
    CONSOLE_URL=http://studio.local.prisme.ai:3000
    API_URL=http://api.local.prisme.ai:3001/v2
    ACCOUNT_VALIDATION_METHOD=auto
    UPLOADS_MAX_SIZE=100mb
    ```

    Ensure DNS entries (`studio.local.prisme.ai`, `api.local.prisme.ai`) point to your Docker host IP.
  </Step>

  <Step title="Start Prisme.ai with Docker Compose">
    Launch Prisme.ai and its dependencies using Docker Compose:

    ```bash theme={null}
    docker-compose up -d
    ```

    This command will start all necessary Prisme.ai microservices and databases (MongoDB, Redis, Elasticsearch).
  </Step>

  <Step title="Verify Deployment">
    Check running containers:

    ```bash theme={null}
    docker-compose ps
    ```

    Verify logs for issues:

    ```bash theme={null}
    docker-compose logs -f
    ```
  </Step>

  <Step title="Access Prisme.ai Studio">
    Visit the URL defined in your `.env` file (e.g., `http://studio.local.prisme.ai:3000`) to access the Prisme.ai Studio.
  </Step>
</Steps>

***

## Docker Best Practices

<CardGroup cols={2}>
  <Card title="Resource Management" icon="memory">
    * Monitor resource usage regularly.
    * Adjust container resource limits using Docker Compose configurations.
  </Card>

  <Card title="Persistent Storage" icon="database">
    * Ensure volumes are correctly configured for persistent storage.
    * Regularly back up Docker volumes.
  </Card>

  <Card title="Network Configuration" icon="network-wired">
    * Utilize dedicated Docker networks for Prisme.ai.
    * Configure proper DNS records for easier access and testing.
  </Card>

  <Card title="Security Measures" icon="shield-halved">
    * Regularly update Docker and images.
    * Limit container privileges and exposure to the host system.
  </Card>
</CardGroup>

***

## Common Commands & Troubleshooting

<AccordionGroup>
  <Accordion title="Docker Compose Useful Commands">
    * **Start containers**:
      ```bash theme={null}
      docker-compose up -d
      ```
    * **Stop containers**:
      ```bash theme={null}
      docker-compose down
      ```
    * **View logs**:
      ```bash theme={null}
      docker-compose logs -f [service-name]
      ```
    * **Restart services**:
      ```bash theme={null}
      docker-compose restart [service-name]
      ```
  </Accordion>

  <Accordion title="Resolving DNS Issues">
    If DNS entries are not resolving:

    * Check your `/etc/hosts` file (Linux/Mac) or `hosts` file (Windows).
    * Ensure wildcard DNS (`*.pages.local.prisme.ai`) is configured correctly.
  </Accordion>

  <Accordion title="Resource Constraints">
    If encountering performance issues:

    * Increase Docker resources (CPU, RAM) in Docker Desktop settings or Docker Engine configurations.
    * Optimize services by tuning environment variables (`UPLOADS_MAX_SIZE`, database caches).
  </Accordion>
</AccordionGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Helm Deployment" icon="ship" href="/self-hosting/kubernetes/helm">
    Explore deploying Prisme.ai using Helm
  </Card>

  <Card title="High Availability" icon="cloud" href="/self-hosting/kubernetes/high-availability">
    Learn about ensuring high availability
  </Card>

  <Card title="Products Configuration" icon="store" href="/self-hosting/configuration/products-installation">
    Configure your Prisme.ai AI products
  </Card>

  <Card title="Install from scratch (v27)" icon="rocket" href="/self-hosting/operations/install-v27">
    Fresh-install walkthrough.
  </Card>

  <Card title="Migration v27" icon="arrow-right-arrow-left" href="/self-hosting/operations/migration-v27">
    Migrate an existing instance to v27.
  </Card>

  <Card title="Operations Management" icon="scale-unbalanced" href="/self-hosting/operations/scaling">
    Learn about scaling operations efficiently
  </Card>
</CardGroup>
