GitHub Deploy Key

A deploy key gives Coolify read-only SSH access to one private GitHub repository without using a personal access token or an account-level SSH key.

Use a deploy key when:

  • Coolify should access only one private repository
  • you cannot install a GitHub App in the organization
  • repository-specific read-only access is preferred

Use a GitHub App when Coolify needs integrated access to several repositories.

Example values

This guide uses:

  • Repository owner: ShadowArcanist
  • Repository name: coolify-dev
  • Key name: Deploy Key Tutorial
  • SSH URL: [email protected]:ShadowArcanist/coolify-dev.git

Create a private key in Coolify

Private Keys page in Coolify
  1. Open Keys & Tokens.
  2. Select Private Keys.
  3. Select + Add.
Generate SSH key actions in Coolify
  1. Select Generate new RSA SSH Key or Generate new ED25519 SSH Key.
Generated SSH public key in Coolify
  1. Copy the public key.
  2. Select Continue to save the key pair.
You can generate the key outside Coolify

Run:

ssh-keygen -t rsa -b 4096 -C "coolify-deploy-key"

Paste the generated private key into Coolify and use the matching .pub file on GitHub.

Add the deploy key on GitHub

Deploy keys page in GitHub repository settings
  1. Open the repository settings.
  2. Select Deploy keys.
  3. Select Add deploy key.

The direct URL has this form:

https://github.com/OWNER/REPOSITORY/settings/keys
New deploy key form on GitHub
  1. Enter a descriptive title.
  2. Paste the public key copied from Coolify.
  3. Keep Allow write access disabled.
  4. Select Add key.
Saved read-only deploy key on GitHub

Copy the repository SSH URL

SSH clone URL in the GitHub Code menu
  1. Open the GitHub repository.
  2. Select Code > Local > SSH.
  3. Copy the SSH URL, such as [email protected]:ShadowArcanist/coolify-dev.git.

Create a resource

Coolify project page with the New button

Open the required project and environment, then select + New.

Select the deploy-key resource type

Private Repository with Deploy Key resource type

Select Private Repository (with Deploy Key).

Choose the server

Self-hosted Coolify includes localhost

A self-hosted installation starts with a localhost server. Coolify selects it automatically when no other deployment server is available.

Server selection for a deploy-key application

Choose the server where the application should run.

Choose the deploy key

Private-key selection for a deploy-key application

Select the private key created in Coolify.

Configure and deploy

SSH repository and build configuration for a deploy-key application
  1. Paste the GitHub SSH URL.
  2. Choose the branch, Build Pack, internal port, and other required settings.
  3. Continue to the application configuration and deploy it.

Open Deployments and confirm that Coolify clones the private repository and requested commit.

Follow GitHub Auto Deploy to deploy new commits through a repository webhook.

On this page