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

# Deploy

## Deploying with Github Repository

Deploying your app to the Morph platform is automated through integration with your Github repository.

Deployed apps are secured with user authentication through Morph accounts.

<Steps>
  <Step title="Create a Github repository">
    Create a Github repository.

    The deployment settings are configured in [`morph_project.yml`](/reference/en/framework/morph-project).
  </Step>

  <Step title="Log in to morph-data.io and connect your Github account">
    Log in to [https://app.morph-data.io/](https://app.morph-data.io/), navigate to the Projects tab and go to the new project creation screen.
    Follow the on-screen instructions to connect your Github account and select your Github repository.
  </Step>

  <Step title="Push your code">
    When you push code to your Github repository, the build will start automatically. Once the build is complete, your app URL will become active.
    The deployed app automatically includes user authentication through Morph accounts. To share with others, first invite them as users before sharing the URL.
  </Step>
</Steps>

<Frame>
  <iframe height={500} width="100%" src="https://www.youtube.com/embed/IEe4SqKnx54?si=6FS0td-gOinBh3hn" />
</Frame>

## Deploying with Docker and Moroh CLI

<Warning>
  This method is not recommended.
</Warning>

<Note>
  The following steps require the `morph` command. If it is not installed, run the command `pip install morph-data` to install it.
</Note>

<Note>
  Docker is required to build the Morph application; if you do not have Docker installed, please install it from the [official Docker website](https://docs.docker.com/get-docker/).
</Note>

<Steps>
  <Step title="Set up your project">
    1. Navigate to the root directory of your project:
       ```bash Shell theme={"dark"}
       cd /path/to/your-project
       ```
    2. Edit the `morph_project.yml` file in the root directory to set the `project_id`:
       ```yaml YAML theme={"dark"}
       # Profile Section in `~/.morph/credentials`
       profile: default

       # Project ID
       project_id: [YOUR_PROJECT_ID]

       # Python Package Manager
       package_manager: pip

       -- omitted --
       ```
       * The `profile` corresponds to the section in `~/.morph/credentials`. Typically, `default` is sufficient, but modify it if you have multiple credentials.
       * The `package_manager` is set to the selected package manager when the project was created. Normally, you do not need to change this. The `morph deploy` command builds based on this setting.
         * If `package_manager=pip` is specified, edit the `requirements.txt` file in the root directory to specify the packages to install in the deployment environment. Otherwise, `requirements.txt` is automatically generated during the build process.
  </Step>

  <Step title="Set up the morph CLI">
    Run the following command to configure the API key in `~/.morph/credentials`:

    ```bash Shell theme={"dark"}
    morph config
    ```
  </Step>

  <Step title="Configure Python packages for the cloud environment">
    <AccordionGroup>
      <Accordion title="poetry">
        The packages specified in pyproject.toml will be installed in the deployment environment.
        Make sure to run the `poetry update` command before deployment to update the poetry.lock file to the latest state.
      </Accordion>

      <Accordion title="uv">
        The packages specified in pyproject.toml will be installed in the deployment environment.
        Make sure to run the `uv sync` command before deployment to update the uv.lock file to the latest state.
      </Accordion>

      <Accordion title="pip">
        The packages specified in requirements.txt will be installed in the deployment environment.

        Run the following command to generate requirements.txt:

        ```bash Shell theme={"dark"}
        pip freeze > requirements.txt
        ```
      </Accordion>
    </AccordionGroup>
  </Step>

  <Step title="Deploy to the cloud">
    Run the following command to deploy to the cloud:

    ```bash Shell theme={"dark"}
    morph deploy
    ```

    * To disable Docker cache, use:

    ```bash Shell theme={"dark"}
    morph deploy --no-cache
    ```

    After deployment, log in to [https://app.morph-data.io/](https://app.morph-data.io/), and check the results.
  </Step>
</Steps>
