Deploy with Git

Deploy your app directly from a git repository and enjoy native continuous deployment on Koyeb.

The easiest way to deploy your apps on Koyeb is to connect the git repository containing your source code and let Koyeb manage the rest.

When using git-driven deployment, each time you push or merge your changes to your production branch, we build your application with all the required dependencies and deploy it in production. You natively benefit from continuous deployments with a completely automated build and deployment process.

This document explains how to deploy an application from a GitHub repository on Koyeb and is composed of two steps:

  1. Deploy your application from a GitHub repository
  2. View the live status of your app and services
  3. Getting started with our example apps

Deploy your application from a GitHub repository

We support git repositories hosted on GitHub. We plan to support more providers like GitLab and Bitbucket.

Koyeb provides the notion of Apps, which contain all the components needed to run your applications, including the ability to run one or more Services per App. Services can be deployed from a git repository or using a container image. You can read more about Koyeb Apps in the Apps Overview documentation.

When you deploy a Service on Koyeb, you have a few customizable settings. All settings can be transparently upgraded after the initial creation.

Connect your GitHub repository

On the Koyeb control panel, click the Create App button. In the Deployment method section, select GitHub. During your first deployment, you are redirected to GitHub to:

  1. Install the Koyeb app in the GitHub organization of your choice
  2. Grant access to Koyeb to the repositories you want to deploy

Once this step is completed, you are redirected to Koyeb. You can now select the repository which contains your app and the branch which should be deployed.

Build

The language and build system is automatically detected depending on the content of your repository. We currently support building applications in: Node.js, Go, Python, Ruby, PHP, Java, and Scala.

If you need to provide a custom build command, you can do so with the Build command field. Be aware that the build command will be executed after the automated build steps.

To learn more about how the language and build system are detected, please refer to this documentation.

Run command

We need to know how to launch your application. There is two options to define the run command:

  1. In the definition of your service with the run command field directly in the console.
  2. In your repository with a Procfile. Simply add a file called Procfile a the root of your repository with the command needed to execute your service in production prefixed by web: like:
web: yarn start

The option you select to define the run command depends on you. Some prefer to have the production command defined inside of their source code repository, others prefer the simplicity of defining it with the service.

Configure your service

  • Pick the right amount of resources to run your application
  • Select the regions of the world where your service will run
  • Define the horizontal scaling and auto-scaling parameters
  • Configure the network ports on which your application listens and if the service should be publicly reachable through Koyeb's global load-balancing
  • Add environment variables and secrets

To dive deeper, read about the Services Options.

Status of your live Service

Once your Service is deployed, you are redirected to the service page and can access your application:

  • via public URLs if you decided to expose it publicly
  • via a private domain through the service mesh from other Services of your App

You will see all the individual instances, their regions, and their status depending on your configuration. Instances might be detected as unhealthy due to a configuration issue.

If your deployment is failing, check the logs panel and refer to our troubleshooting deployments guide.

Getting started with our example apps

We provide example apps using various languages and frameworks on GitHub to get you started faster. Check out examples for:

To deploy the example application, look for the Deploy to Koyeb button in the readme of the repository. Deploy to Koyeb

Clicking on this button brings you to the Koyeb App creation page with everything pre-set to launch the example application.

For more details on the apps, check the readme!