FROM CODE TO BUILD AND DEPLOY

Your first pipeline on your server.

Use your repository and a Dockerfile. Runner fetches the code, builds the image and deploys it on the same Linux server with Docker. The main path below needs no external worker and no pushing the app image to a registry.

01 /

Install on the target server.

Read the script before running it with sudo. Use the official install command on the server that will host your apps.

Install · shellbash · example
curl -sL https://get.runnerci.com/init.sh | sudo bash

02 /

Prepare the Dockerfile and the manifest.

In your app's checkout, use the wizard to generate .deploy.yml with a Dockerfile build. Review the file and commit it to the branch Runner will track. The example is for an app on port 3000 whose GET /health returns 2xx; adjust the fields to your app.

Generate in the web wizard ↗
Wizard in the app checkoutbash · example
runner wizard --path . --out ./.deploy.yml
Manifest for a local buildyaml · example
project: my-app
system: api
type: docker-build
build:
  context: .
  dockerfile: Dockerfile
port: 3000
healthcheck:
  mode: http
  path: /health
version:
  source: git-commit
instances:
  production:
    source:
      type: branch
      branch: main
    keep_versions: 3

The manifest and the Dockerfile must be in the repository before you register. Configure credentials if the repo is private. Use an unused project and replace my-org/my-app and main with your repo and branch; adjust the commands if you change project.

03 /

Register and run the pipeline.

On the target server, register the repository and make the first deploy. Runner fetches the code, runs the Dockerfile locally, starts the container and checks the healthcheck.

Build and deploy on the serverbash · example
runner add --repo my-org/my-app --branch main --ckey v2
runner deploy my-app
runner status my-app

Check the build in the logs and the container running with health healthy. This example publishes no host port and configures no domain; prepare Traefik, DNS and the domain in the manifest for public access.

04 /

Turn on automatic runs.

In the crontab of the user that operates Runner on the server (root in the default install), check whether the entry below already exists. Add it once if it's missing and make sure the cron service is running. You don't need to trigger each deploy from the terminal.

Server crontab entrycron · example
*/5 * * * * /usr/local/bin/runner fetch --deploy

With the default schedule active, Runner checks the source every five minutes. Since the example uses git-commit, every new commit on main becomes a new version and triggers the pipeline automatically on the next detection.

Rather try it with a prebuilt image? See the optional path.

First app: a public image.

Save this manifest as deploy.yml. image holds the repository without a tag; track picks 2-alpine. poll: false keeps this exercise manual. Caddy answers on / at internal port 80, not exposed on the host.

deploy.ymlyaml · example
project: my-app
system: front
type: front-static
image: caddy
image_mode: prebuilt
port: 80
healthcheck:
  mode: http
  path: /
instances:
  production:
    source:
      type: registry
      track: 2-alpine
      poll: false
    keep_versions: 3
First app: a public image.bash · example
runner add --image caddy --manifest-file ./deploy.yml --ckey v2

A public image needs no registry credentials. Use an unused project identity: if my-app already exists, change project and the commands that follow. Registering creates the app's state; the deploy comes next.

Deploy. Then check.

The deploy resolves the tag to a digest, pulls the image and waits for the HTTP healthcheck. In status, look for the container running and health healthy. With no domain, this example creates no public route.

First deploy · shellbash · example
runner deploy my-app
runner status my-app

Expected result: container running and health healthy. That confirms the container is healthy; configure a domain and Traefik to make your app publicly available.

From the exercise to your app.

Secrets

Use ckey v2 and enter values by prompt or stdin, keeping them out of shell history. Changing env alone doesn't recreate the container; run a new deploy with --force when you need to apply the change.

Domain and TLS

Prepare DNS and Traefik; declare domain and routing.tls in your app's manifest. The gatekeeper tracks pending domains and delegates the certificate to Traefik.

Automation and notifications

For code in Git, choose the branch and version source and keep the schedule active. For a prebuilt image, configure tags or track and polling. Set up notifications to follow pipeline results.