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

# Deploying with ale

<video autoPlay muted loop playsInline className="w-full aspect-video" src="https://storage.googleapis.com/files.cloudtype.io/ale-docs/developers/images/en/deploy_en.mp4" />

> The deployment process starts through the deployment modal, which can be opened via the <Icon icon="circle-plus" iconType="solid" size={15} color="2396F1" /> button in the dashboard or by `⌘ + K`.

<Tip>
  Templates provided by `ale` have different default modules and libraries. If you need to use libraries that aren't provided by default, such as <Icon icon="windows" size={15} color="9fa3a5" /> Windows or <Icon icon="chrome" size={15} color="9fa3a5" /> Chrome libraries, use [Dockerfile Template](/en/developers/dockerfile).
</Tip>

***

## Select Deployment source

<AccordionGroup>
  <Accordion title="Deploy from GitHub Repository">
    #### Select a Repository to Deploy

    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_02.png" />
    </Frame>

    > Click **Deploy Git Repository** in the deployment modal, then select a repository.

    #### Select a Preset

    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_03.png" />
    </Frame>

    > Choose the preset that matches the repository.

    <Tip>
      For static sites like React or Vue, select **Web Application**.
    </Tip>
  </Accordion>

  <Accordion title="Deploy via Git URL">
    #### Add Deploy Key

    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_04.png" />
    </Frame>

    > After selecting 'Deploy Git Repository' and navigating to the 'Git URL' tab, input the SSH Git URL of your repository. A Deploy Key will be generated automatically.

    <Info>
      `ale` supports SSH authentication for deploying private repositories from GitHub, GitLab, Bitbucket, and other git providers. See below for platform-specific deploy key setup.
    </Info>

    <AccordionGroup>
      <Accordion title="GitHub">
        <Frame>
          <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_06.png" />
        </Frame>

        > Go to **Settings > Deploy keys** in your repository. Then click `Add deploy key` in the top right corner and paste the deploy key from `ale`.
      </Accordion>

      <Accordion title="GitLab">
        <Frame>
          <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_07.png" />
        </Frame>

        > Go to **Settings > Repository** in your repository. Under the **Deploy keys** section, click `Expand`, then `Add new key`, and paste the deploy key from `ale`.
      </Accordion>

      <Accordion title="Bitbucket">
        <Frame>
          <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_08.png" />
        </Frame>

        > Go to **Repository settings > Access keys** in your repository. Click `Add key` and paste the deploy key from `ale`.
      </Accordion>
    </AccordionGroup>

    #### Select a Preset

    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_05.png" />
    </Frame>

    > Choose the preset that matches the repository.

    <Tip>
      For static sites like React or Vue, select **Web Application**.
    </Tip>
  </Accordion>

  <Accordion title="Deploy from Template">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_01.png" />
    </Frame>

    Select a template for your service and choose a GitHub repository or input a Git URL.

    <Tip>
      For static sites like React or Vue, select **Web Application**.
    </Tip>
  </Accordion>
</AccordionGroup>

## Configure and Deploy

> After selecting the source and preset, configure the deployment settings below and deploy.

<AccordionGroup>
  <Accordion title="Branch and Subdirectory">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_10.png" />
    </Frame>

    > After selecting a repository, fields for configuring the branch and subdirectory will appear. If your service is located in a subfolder instead of the root directory—such as when managing multiple services in one repository—enter the subfolder path in the Subdirectory field.

    <Info>
      If this field is left blank, the root directory will be used for build and deployment by default.
    </Info>

    <Tip>
      For more details, see the [Deploy from Subdir page](/en/developers/subdir).
    </Tip>
  </Accordion>

  <Accordion title="Version">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_11.png" />
    </Frame>

    > Select the preset version that matches the repository.

    <Warning>
      Build or runtime failures may occur if the version specified in the project configuration files (build.gradle, package.json, requirement.txt, etc.) doesn't match the version selected.
    </Warning>
  </Accordion>

  <Accordion title="Environment Variables">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_12.png" />
    </Frame>

    > Environment variables can be added using any combination of the following methods:

    * **Drag and Drop** ENV files
    * **Directly add variables** using the <Icon icon="circle-plus" iconType="solid" size={15} color="2396F1" />
    * **Select from saved secrets** using the <Icon icon="key" iconType="solid" size={15} />

    <Info>
      For more information about managing environment variables and secrets, see the [Environment Variables page.](/en/developers/env)
    </Info>
  </Accordion>

  <Accordion title="Port Number">
    > The port number must match the value specified in your source code or environment variables. If the port number is missing or incorrect, the service will fail to start.

    <Warning>
      If this field is left blank, the service will be deployed without a port.
    </Warning>
  </Accordion>

  <Accordion title="Install, Build, Start Command">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_13.png" />
    </Frame>

    > Configure the lifecycle commands for your service.

    * **Install Command**: Enter the command to install dependencies (e.g., `npm install`, `pip install -r requirements.txt`)
    * **Build Command**: Enter the command to build your application (e.g., `npm run build`, `gradle build`)
    * **Start Command**: Enter the command to run your service (e.g., `npm start`, `python app.py`)

    <Info>
      If left empty, the default command shown in the placeholder will be used.
    </Info>
  </Accordion>

  <Accordion title="More Options">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_14.png" />
    </Frame>

    > Configure additional deployment settings.

    <Info>
      Available configuration fields will vary based on your selected template/preset. See below for language-specific settings.
    </Info>

    <CardGroup cols={4}>
      <Card title="springboot" icon="leaf" href="/en/developers/springboot" horizontal />

      <Card title="node.js" icon="node" href="/en/developers/node" horizontal />

      <Card title="Database" icon="database" href="/en/developers/database" horizontal />

      <Card title="docker" icon="docker" href="/en/developers/dockerfile" horizontal />
    </CardGroup>
  </Accordion>

  <Accordion title="Resource Settings and Deploy">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_15.png" />
    </Frame>

    * **Resource Type**: Select between [On-demand or Spot instance types](/en/developers/resource#on-demand-spot)
    * **CPU**: Maximum vCPU resource for the service. Minimum vCPU means 0.1 vCPU
    * **Memory**: Maximum memory size the service can use
    * **Disk**: Database disk capacity (Available for database services only)
    * [Replica](/en/developers/replica): Number of service replicas for high availability and load balancing
    * **Deploy**: Click `Deploy`
  </Accordion>
</AccordionGroup>

<Tip>
  If deployment fails due to resource limitations, see the [Space and Resource Management page](/en/operations/spaces#allocate-resources) to add resources to the space.
</Tip>

<Info>
  Available configuration fields will vary based on your selected template/preset. See below for language-specific settings.
</Info>

<CardGroup cols={4}>
  <Card title="springboot" icon="leaf" href="/en/developers/springboot" horizontal />

  <Card title="node.js" icon="node" href="/en/developers/node" horizontal />

  <Card title="Database" icon="database" href="/en/developers/database" horizontal />

  <Card title="docker" icon="docker" href="/en/developers/dockerfile" horizontal />
</CardGroup>

## Logs & Terminal

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_16.png" />
</Frame>

> Click the **<Icon icon="terminal" size={15} color="9fa3a5" /> icon** in the service card or service page to check deployment/runtime logs or access the terminal.

## Metrics

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_25.png" />
</Frame>

> You can view service metrics in the Metrics tab of the service page.

## Update

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_17.png" />
</Frame>

> When you update your code or modify resource settings, click `Deploy` at the bottom of the service settings page to apply these changes with a new deployment.

<Tip>
  To set up automated deployments using GitHub Actions, see the [GitHub Actions page](/en/developers/githubactions).
</Tip>

## Rollback

<Frame>
  <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_20.png" />
</Frame>

> To restore your service to a previous version, navigate to **the deployment history tab in the service page.**

<Tip>
  Check the commit messages in the deployment history to ensure you're rolling back to the intended version.
</Tip>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Subdirectory Not Applied (Error: Project files not found)">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_10.png" />
    </Frame>

    > Builds are executed from the root directory during deployment. If your application source code is located in a subdirectory rather than the root directory of the repository, you need to configure the subdirectory path in your settings.
  </Accordion>

  <Accordion title="Version Mismatch">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_11.png" />
    </Frame>

    > Build or runtime failures may occur if the version specified in the project configuration files (build.gradle, package.json, requirement.txt, etc.) doesn't match the version selected. [Set the appropriate versions according to your project and deploy again.](/en/developers/deploy#update)
  </Accordion>

  <Accordion title="Port Number Issues">
    * To avoid runtime issues, ensure that the correct port numbers are set in your deployment settings for applications that require specific ports. **If your application assigns ports dynamically, leave the port number field blank in the deployment settings.**
  </Accordion>

  <Accordion title="Using Chrome Libraries like Selenium and Puppeteer">
    * Templates provided by `ale` have different default modules and libraries. If you need to use libraries that aren't provided by default, such as <Icon icon="windows" size={15} color="9fa3a5" /> Windows or <Icon icon="chrome" size={15} color="9fa3a5" /> Chrome libraries, you'll need to deploy using a [Dockerfile](/en/developers/dockerfile).

    <Tip>
      You can either install plugins that support the required libraries, or add them directly through plugin development.
    </Tip>
  </Accordion>

  <Accordion title="CORS Issues">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/reverse02.png" />
    </Frame>

    > CORS solutions vary by framework, and issues can be resolved using framework-specific libraries or modules. While frameworks like Next.js offer built-in reverse proxy solutions through their Rewrites feature, you can use **Rewrites configuration** to set up reverse proxying when deploying web applications like React or Vue. See the [reverse proxy page](/en/developers/reverseproxy) for detailed configuration guidelines.
  </Accordion>

  <Accordion title="Missing Runtime Logs">
    * Click the `play` button on the service card to restart the service and check the runtime logs. If logs are still not visible, check the Events tab on the service page to troubleshoot the issue.
  </Accordion>

  <Accordion title="Memory Resource Exhaustion (OOM)">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_23.png" />
    </Frame>

    * JVM applications may experience Out of Memory (OOM) errors when memory usage exceeds allocated resources. Node.js applications can similarly face heap memory limitations. To resolve this, either configure memory settings in your application or [deploy with increased resource limits.](/en/developers/resource#resource-scaling)
  </Accordion>

  <Accordion title="Timezone">
    <Frame>
      <img className="block rounded-md" src="https://files.cloudtype.io/ale-docs/developers/images/en/06_21.png" />
    </Frame>

    > Set the timezone using the TZ environment variable. You can find the list of supported timezone formats [here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For framework-specific configuration options, consult your framework's documentation.
  </Accordion>
</AccordionGroup>

## Reference

* [GitHub Actions](/en/developers/githubactions)
* [Dockerfile](/en/developers/dockerfile)
* [Adding Resources](/en/operations/spaces#allocate-resources)
