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

# Deploying on a VPS

> Step-by-step guide to deploying GenAI Launchpad on a production Linux server

This tutorial provides a step-by-step process for deploying the GenAI Launchpad on a production-ready Linux server.

## Prerequisites

Before proceeding, ensure you have the following:

* A remote server running a Linux distribution (Ubuntu recommended)
* SSH access to the server
* (Optional) A custom domain with access to DNS settings

## Deployment

<Steps>
  <Step title="Connect to the server">
    Log in to your remote server via SSH:

    ```bash theme={null}
    ssh username@remote-ip-address
    ```
  </Step>

  <Step title="Install Docker">
    Docker is required to run the Launchpad. Follow the [official installation instructions](https://docs.docker.com/engine/install/) for your Linux distribution.

    For Ubuntu, execute the following commands:

    ### Set up Docker's APT repository

    ```bash theme={null}
    sudo apt-get update
    sudo apt-get install -y ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc

    echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
    https://download.docker.com/linux/ubuntu \
    $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
    sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
    ```

    ### Install Docker

    ```bash theme={null}
    sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    ```

    ### Verify installation

    Ensure Docker is installed correctly by running:

    ```bash theme={null}
    sudo docker run hello-world
    ```
  </Step>

  <Step title="Clone the repository">
    To deploy the Launchpad, clone the repository onto your server. First, add an SSH key to your GitHub repository.

    <Info>
      Replace the repository URL below with your own private GenAI Launchpad repository.
    </Info>

    ### Generate an SSH key

    Generate a new SSH key pair:

    ```bash theme={null}
    ssh-keygen -f ~/.ssh/github
    ```

    Follow the prompts. If you do not wish to set a passphrase, press `Enter` to skip.

    Print the public key:

    ```bash theme={null}
    cat ~/.ssh/github.pub
    ```

    Copy the output, as it will be needed in the next step.

    ### Add the SSH key to GitHub

    1. Navigate to your GitHub repository.
    2. Open **Settings**.
    3. In the left menu, go to **Security > Deploy keys**.
    4. Click **Add deploy key** and provide:
       * **Title:** `genai-launchpad-prod`
       * **Key:** Paste the copied public key.
    5. Click **Add key**.

    ### Clone the repository

    Run the following command to clone the repository to the server:

    ```bash theme={null}
    cd /opt && git clone git@github.com:datalumina/genai-launchpad.git
    ```
  </Step>

  <Step title="Configure environment variables">
    Configure the environment file for the runtime you are deploying.

    * `.env` at the repo root is for local Python development: playground scripts, unit tests, notebooks, and other commands run with your local `uv`/Python environment.
    * `docker/.env` is for Docker Compose, the containerized Launchpad stack, the database, and optional Supabase services. This is the important file for a VPS deployment.

    `docker/.env` is much larger mostly because self-hosted Supabase needs many variables for Auth, Realtime, Storage, Studio, Kong, and related services, even though Supabase is excluded by default.

    <Warning>
      Replace default credentials with secure values before deploying to production.
    </Warning>
  </Step>

  <Step title="Enable HTTPS (optional)">
    <Info>
      This step is optional. Skip if you don't need HTTPS or don't have a custom domain.
    </Info>

    If you intend to use HTTPS, you must have a domain and configure the appropriate DNS settings.

    ### Configure domain

    1. Create an **A record** in your domain's DNS settings, pointing to your server's IP address.
    2. Modify the `.env` file in the `docker/` directory to include:

    ```dotenv theme={null}
    CADDY_DOMAIN=https://yourdomain.com
    ```

    ### Open required ports

    Ensure ports 80 and 443 are open on your server's firewall:

    * **Port 80**: Required for Let's Encrypt certificate validation (ACME challenge)
    * **Port 443**: Required for HTTPS traffic

    If using `ufw`:

    ```bash theme={null}
    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
    ```
  </Step>

  <Step title="Start the application">
    Navigate to the `docker/` directory:

    ```bash theme={null}
    cd /opt/genai-launchpad/docker
    ```

    Run the startup script:

    ```bash theme={null}
    ./start.sh
    ```
  </Step>
</Steps>
