Understand how to setup the Deploy to Koyeb button to provide one click deployments of your apps
The Deploy to Koyeb button helps users deploy applications from a GitHub repository or a Docker image with one single click. As a developer, it lets you create a fast deployment option for your users.
You can add the Deploy to Koyeb button to your documentation and readme files to allow your users to deploy your application with zero configuration.
The Deploy to Koyeb button can be configured to deploy public pre-built Docker images hosted on a container registry or GitHub repositories. When configured to deploy from a private Repository, the Koyeb user account must be linked with GitHub and have access to the repository.
Below is an example of the Deploy to Koyeb button that deploy a simple NestJS application on Koyeb from a public GitHub repository.
To add the Deploy to Koyeb button to your repository, you can use the following Markdown snippet as a template:
[](https://app.koyeb.com/deploy?...)
The Deploy to Koyeb button configuration is passed using URL query parameters. Below is the list of arguments accepted by the button:
type
(required): The deployment source to use. Can be git
or docker
, e.g. type=git
.name
(required): The name of the application to deploy, e.g. name=my-app
.ports
: A list of ports your application needs to expose. e.g. ports=8080;http;/
or for multiple ports ports=8080;http;/api&ports=8081;http;/
.env
: A list of environment variables required to run the application. e.g. env[my-key]=my-value
or for multiple environment variables env[myKey1]=myValue1&env[myKey2]=myValue2
.Parameters accepted when the button type
is set to git
:
repository
(required): The repository to deploy from, e.g. repository=github.com/koyeb/example-nestjs
.branch
(required): The branch to deploy from, e.g. branch=main
.run_command
: The command to run to launch the application deploying, e.g. run_command=yarn start
.build_command
: The command to run during the build of your application, e.g. build_command=yarn%build-command
.Parameters accepted when the button type
is set to docker
:
image
(required): The repository to deploy from, e.g. image=docker.io/koyeb/koyeb-demo:latest
.command
: The command to pass to the container, e.g. command=/bin/sh
.args
: The args to pass to the container, e.g. args=arg1&args=arg2
.Below are two examples of the minimal configuration of the Deploy to Koyeb button to:
https://app.koyeb.com/deploy?type=git&repository=github.com/koyeb/example-nestjs&branch=main&name=nestjs-on-koyeb
https://app.koyeb.com/deploy?type=docker&image=docker.io/koyeb/demo&name=koyeb-demo