Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Drone CI: Getting Started

By Kokil Thapa | Last reviewed: September 2026

Drone CI: Getting Started is simpler than it looks once you split the problem in two. You run a small Drone server that talks to GitHub or GitLab. You attach one or more Drone runners that execute pipeline steps in containers. Most teams stall on OAuth, runner registration, or a vague .drone.yml file. This guide walks through a working path on Ubuntu with PHP 8.3, Laravel 13, and a deploy hook you can adapt. If you already run GitLab CI for Laravel, Drone feels familiar — YAML pipelines, Docker steps, and secrets — with a lighter control plane.

What Is Drone CI Getting Started Architecture in 2026?

Drone is a container-native CI engine. The server listens for webhooks from your SCM. It schedules work. Runners pull jobs and run each step as a Docker container. There is no heavy JVM stack and no bundled Git hosting. That separation keeps the server small and pushes compute to runners you control.

In practice, a three-node mental model is enough for your first week. One VM runs the Drone server plus a reverse proxy. One or more VMs (or the same box for trials) run Drone runners. Your Git provider remains the source of truth for code and pull requests.

Drone CI Getting Started — Core TopologyGit HostGitHub / GitLabDrone ServerWebhooks + UIDrone RunnerDocker executorhookjobsPipeline Steps in Containersclone → composer → test → build → deploy
Drone CI getting started topology: SCM webhooks hit the server; runners execute containerized pipeline steps.

Drone 2.x remains the stable line most teams run today. Runners use the Docker executor by default. Each step declares an image — for example php:8.3-cli or composer:2.10 — and a shell script block. Official reference material lives at docs.drone.io. The project source is maintained at github.com/harness/drone.

Why pick Drone over a bundled platform? You may already host GitLab but want CI agents on a cheap VPS. You may run Gitea on a single box and need lightweight automation. You may want pipeline YAML that travels with the repo without importing an entire DevOps suite. For Laravel shops, that maps cleanly to Composer installs, Pest or PHPUnit runs, Vite 8.x asset builds, and Deployer-style release steps.

How Do You Install Drone CI for Getting Started on Ubuntu?

Assume Ubuntu 24.04, Docker Engine installed, and a domain such as drone.example.com pointed at the server. Terminate TLS with Nginx or Caddy before you expose the Drone UI. The server container stores state in SQLite for trials or Postgres for production.

Create the OAuth application

GitHub: Settings → Developer settings → OAuth Apps. Set the callback URL to https://drone.example.com/login. Copy the client ID and secret. GitLab follows the same pattern under Admin → Applications. Without a correct callback URL, login loops fail silently and waste an hour.

Run the Drone server container

docker volume create drone-data

docker run \
  --volume=drone-data:/data \
  --env=DRONE_GITHUB_CLIENT_ID=your_client_id \
  --env=DRONE_GITHUB_CLIENT_SECRET=your_client_secret \
  --env=DRONE_RPC_SECRET=choose_a_long_random_string \
  --env=DRONE_SERVER_HOST=drone.example.com \
  --env=DRONE_SERVER_PROTO=https \
  --env=DRONE_USER_CREATE=username:your_github_user,admin:true \
  --publish=80:80 \
  --detach=true \
  --name=drone \
  drone/drone:2

Replace GitHub variables with GitLab equivalents if needed (DRONE_GITLAB_CLIENT_ID, etc.). Set DRONE_USER_CREATE so the first login is not a race for admin rights. Store secrets in a password manager, not in shell history.

Register a Docker runner

Install the runner on the same host or a separate build VM. The runner must reach the server RPC endpoint and have Docker socket access.

docker run -d \
  --volume=/var/run/docker.sock:/var/run/docker.sock \
  --env=DRONE_RPC_PROTO=https \
  --env=DRONE_RPC_HOST=drone.example.com \
  --env=DRONE_RPC_SECRET=choose_a_long_random_string \
  --env=DRONE_RUNNER_CAPACITY=2 \
  --env=DRONE_RUNNER_NAME=build-01 \
  --publish=3000:3000 \
  --name=runner \
  drone/drone-runner-docker:1

Match DRONE_RPC_SECRET exactly on server and runner. After registration, the Drone UI under Settings → Runners should show build-01 idle. If the runner stays offline, check firewall rules and TLS trust on the runner host. Deeper hardening patterns overlap with self-hosted CI runner security guidance.

  1. Point DNS and enable HTTPS on the Drone host.
  2. Create OAuth credentials on your Git host.
  3. Start the Drone server with RPC secret and admin bootstrap user.
  4. Start at least one runner with the same RPC secret.
  5. Log in, activate your first repository, and commit .drone.yml.

For ongoing server care — updates, backups, log rotation — treat the Drone host like any other production box. Many Nepal teams bundle that work with Linux system administration retainers rather than learning Docker ops from scratch under deadline pressure.

What Does a Drone CI Pipeline Look Like When Getting Started?

Every activated repo reads pipeline config from .drone.yml at the root. Drone maps Git events to pipelines: push, pull request, tag, promote, and cron. Steps run sequentially unless you declare parallel stages with the graph syntax.

Below is a practical Laravel 13 pipeline. It installs Composer 2.10 dependencies, runs Pest tests, builds front-end assets with Node.js 26 LTS, and optionally deploys from main only.

kind: pipeline
type: docker
name: default

trigger:
  branch:
    - main
    - develop
  event:
    - push
    - pull_request

steps:
  - name: backend
    image: php:8.3-cli
    commands:
      - apt-get update && apt-get install -y git unzip libzip-dev
      - docker-php-ext-install zip
      - curl -sS https://getcomposer.org/installer | php -- --2
      - php composer.phar install --no-interaction --prefer-dist
      - cp .env.example .env
      - php artisan key:generate
      - vendor/bin/pest

  - name: frontend
    image: node:26-bookworm
    commands:
      - npm ci
      - npm run build
    when:
      branch:
        - main
        - develop

  - name: deploy
    image: plugins/webhook
    settings:
      urls:
        - https://deploy.example.com/hooks/drone
      content_type: application/json
    when:
      branch:
        - main
      event:
        - push
    environment:
      DEPLOY_TOKEN:
        from_secret: deploy_token

Add secrets in the Drone UI under Repository Settings → Secrets. Never commit tokens. Patterns mirror CI/CD secrets management best practices: short-lived deploy keys, scoped API tokens, and separate secrets per environment.

Drone CI Getting Started — Pipeline FlowGit PushCloneTestBuildDeploy HookEach step runs in its own container image
Typical Drone CI getting started pipeline: webhook triggers clone, test, asset build, and conditional deploy.

Speed up repeat builds

Drone supports volumes and cache plugins. Mount Composer cache between runs to cut minutes off PHP installs. The same ideas apply across engines; see build caching in CI for host-level strategies. For database-backed tests, wire a MySQL 8.4 service container in a separate pipeline or use SQLite in memory for unit suites only.

Gate merges on tests

Protect your default branch on the Git host. Require Drone status checks before merge. Add Pest coverage thresholds if your team tracks quality metrics — code coverage gates in CI explains the policy side. Run migrations in a dedicated step when integration tests need a fresh schema; database migrations in CI pipelines covers ordering and rollback thinking.

On projects I maintain with GitLab CI and Deployer, the deploy step is often a thin webhook that triggers a zero-downtime release script on the app server. Drone fits that model without forcing you off your existing Git host. A booking platform like Adventure Third Pole Trek benefits from the same pattern: test on push, deploy only from protected branches.

How Does Drone CI Compare to GitLab CI for Getting Started?

Teams ask this during every CI bake-off. Drone is not a full DevOps suite. GitLab CI ships inside GitLab with registry, issues, and permissions already wired. GitHub Actions lives inside GitHub with a massive marketplace. Drone wins when you want minimal ops overhead and already have a Git host you like.

CriteriaDrone CIGitLab CIGitHub Actions
Hosting modelSelf-hosted server + runnersGitLab omnibus or SaaSGitHub-hosted or self-hosted runners
Config file.drone.yml.gitlab-ci.yml.github/workflows/*.yml
Execution unitDocker container per stepDocker/Kubernetes executorRunner VM or container job
SecretsUI + from_secretCI variables (masked)GitHub Secrets
Best fitExisting Git host + own VPSAll-in-one GitLab shopsGitHub-centric open source
Ops burdenYou patch server/runnersHigher if self-hosting GitLabLower on github.com

Read GitHub Actions vs GitLab CI for a wider lens. Drone sits beside tools like Buildkite, TeamCity, and Bitbucket Pipelines — all YAML-ish, all runner-centric, differing mostly in pricing and ecosystem.

Choosing Drone CI Getting Started PathNeed CI now?GitHub onlyTry Actions firstSelf-hosted GitDrone fits wellFull DevOps suiteGitLab omnibusDrone CI Getting StartedOwn runners, minimal server, any Git host
Decision tree for Drone CI getting started versus GitHub Actions and GitLab CI.

Cost matters for Nepal agencies billing in NPR. A Drone server on a Rs 2,500/month VPS (~USD 19) plus a build runner can serve many repos. GitLab SaaS per-seat fees climb faster than hardware for small shops. SaaS GitHub Actions free tiers cap minutes; self-hosted Drone trades labour for control.

What Are Common Drone CI Getting Started Mistakes in Production?

Most first-week failures repeat the same themes. I have seen them on client migrations from manual FTP deploys to any CI engine. Drone's simplicity exposes misconfiguration quickly because there are fewer moving parts to hide behind.

  • RPC secret mismatch — runner never picks up jobs; verify identical strings on both sides.
  • OAuth callback typo — login succeeds on HTTP but fails on HTTPS, or trailing slash breaks match.
  • Docker socket on shared runners — any pipeline can mount host paths; isolate build VMs per client or use Kubernetes runners for untrusted code.
  • Missing branch filters — deploy steps firing on every feature branch; use when blocks aggressively.
  • Secrets in logs — echo debugging prints tokens; enable Drone's mask behavior and audit with secrets scanning in Git and CI.
  • No resource limits — parallel npm and Composer jobs OOM the runner; set DRONE_RUNNER_CAPACITY conservatively.

Validate YAML before push. A malformed step name blocks the entire pipeline parse. Keep a staging repo that mirrors production permissions but deploys to a sandbox vhost. Run integration tests in CI only after unit tests pass — Drone's sequential default makes that ordering natural.

Drone CI Getting Started — Fix Common BlockersRunner offlineCheck RPC secret + TLSOAuth loopFix callback URLSlow buildsAdd Composer cache volumeLeaked secretRotate + scan repoStable Drone CI Getting StartedProtected branches + status checks + deploy gates
Production blockers during Drone CI getting started and the fixes that unblock teams fastest.

Advanced teams combine Drone with portable pipeline tools. Dagger pipelines as code can wrap the same build logic if you later swap runners. Blue-green deploys still happen on the app server — Drone only triggers them; read blue-green deployment in CI/CD for the release-side pattern.

When you outgrow a single runner, add labels (platform: linux, env: production) and target steps with node selectors. That mirrors GitLab runner tags without re-architecting your repos. For Laravel-specific test tuning, Pest in CI/CD and parallel test runs with Paratest remain valid inside Drone containers.

Debugging pipeline YAML is easier with small utilities — paste malformed config into the JSON formatter when converting plugin settings, or validate regex conditions in the regex tester before you commit trigger rules.

Key Takeaways

  • Drone CI getting started splits into server install, OAuth login, runner registration, and a root .drone.yml — skip none of the four.
  • Use Docker executor runners on isolated VMs; never treat a shared Docker socket as multi-tenant safe without hardening.
  • Model Laravel pipelines as Composer install, Pest tests, Vite build, and a gated deploy webhook from main only.
  • Pick Drone when you already have a Git host and want lightweight self-hosted CI instead of an omnibus platform.
  • Protect branches, store secrets in Drone — not Git — and add cache volumes early to save runner RAM and wall-clock time.
  • Plan server backups and upgrades before you activate twenty client repos; ops debt arrives quietly after the first success.

People Also Ask

Is Drone CI free for getting started?

Drone Community Edition is open source under Apache 2.0. You pay for VPS hosting, engineer time, and optional enterprise support from Harness. There is no per-minute SaaS meter like cloud-hosted Actions. For a two-person agency, that predictable cost often beats seat-based pricing.

Can Drone CI run without Docker?

The default and best-documented path is the Docker runner. Exec and SSH runners exist for bare-metal scripts, but container isolation is the main reason teams adopt Drone. Stick with Docker until you hit a concrete limitation.

Does Drone CI support monorepos?

Yes. Use trigger paths, glob filters, or separate pipeline files included via YAML anchors. Each changed app can run its own test suite. The same monorepo strategies described for PHP apps in multi-app CI guides apply with Drone trigger syntax.

How do you migrate from Jenkins to Drone CI?

Rewrite Jenkinsfile stages as Drone steps with equivalent container images. Move credentials into Drone secrets. Run both systems in parallel on a non-production repo until parity is proven. Retire Jenkins job by job rather than big-bang cutover.

Ship Your First Drone Pipeline This Week

Drone CI: Getting Started boils down to a small server, honest runner hygiene, and a pipeline file you version beside your app. Stand up a trial on one repo, protect the default branch, and prove deploy from green builds only. Once that loop works, activating the rest of your portfolio is mostly copy-paste with per-repo secrets.

If you want help designing CI for Laravel, WordPress, or a mixed client fleet — including runner hardening on Ubuntu — review the custom software development and support and maintenance services, browse the project portfolio, or contact us to walk through your Git host and deploy target.

Frequently Asked Questions

Drone CI is container-native CI: a server receives Git webhooks, runners execute pipeline steps in Docker. Getting started means installing the server, OAuth to your Git host, registering at least one runner, and committing .drone.yml at the repo root.

Drone Community Edition is free under Apache 2.0. Expect VPS hosting around Rs 2,500/month (~USD 19) for server plus runner, plus engineer time—not per-minute SaaS billing like cloud-hosted Actions.

Exec and SSH runners exist, but Docker is the default and best-documented path. Container isolation is the main reason teams adopt Drone—stick with Docker until you hit a concrete limitation.

Use Ubuntu 24.04 with Docker Engine and a domain such as drone.example.com behind Nginx or Caddy for TLS. Create a GitHub OAuth app under Settings → Developer settings → OAuth Apps with callback URL https://drone.example.com/login, or the GitLab equivalent under Admin → Applications. Run drone/drone:2 with DRONE_GITHUB_CLIENT_ID, DRONE_GITHUB_CLIENT_SECRET, DRONE_RPC_SECRET, DRONE_SERVER_HOST, DRONE_SERVER_PROTO=https, and DRONE_USER_CREATE so your first login has admin rights. Use SQLite for trials or Postgres for production. Store secrets in a password manager, not shell history—a wrong callback URL causes login loops that fail silently.

Run drone/drone-runner-docker:1 on the same host or a separate build VM with Docker socket access and network reach to the server RPC endpoint. Set DRONE_RPC_PROTO, DRONE_RPC_HOST, and DRONE_RPC_SECRET to match the server exactly, plus DRONE_RUNNER_CAPACITY and DRONE_RUNNER_NAME. After startup, Settings → Runners in the Drone UI should show your runner idle. If it stays offline, check firewall rules and TLS trust on the runner host. RPC secret mismatch is the most common first-week blocker I see on client migrations—verify identical strings on both sides before chasing other causes.

A three-node mental model is enough for your first week. One VM runs the Drone server plus a reverse proxy terminating HTTPS. One or more VMs—or the same box for trials—run Drone runners using the Docker executor. Your SCM stays the source of truth for code and pull requests. The server listens for webhooks, schedules work, and stores state in SQLite for trials or Postgres for production. Runners pull jobs and run each .drone.yml step as its own container image. Drone 2.x is the stable line most teams run today, with no bundled Git hosting or heavy JVM stack.

Place .drone.yml at the repo root with triggers on push and pull_request to main and develop. A backend step uses php:8.3-cli to install Composer 2.10 dependencies, copy .env.example, generate an app key, and run Pest. A frontend step on node:26-bookworm runs npm ci and npm run build on protected branches. Deploy from main only via plugins/webhook pointing at your deploy hook, with DEPLOY_TOKEN from Drone repository secrets—not Git. Steps run sequentially by default. On projects I maintain with GitLab CI and Deployer, the deploy step is often the same thin webhook pattern; Drone fits without changing your Git host.

GitLab CI ships inside GitLab with registry, issues, and permissions already wired. Drone is not a full DevOps suite—it is a lightweight self-hosted server plus runners for teams that already have a Git host they like. Both use YAML pipelines and Docker steps: .drone.yml versus .gitlab-ci.yml. Secrets live in the Drone UI via from_secret, similar to masked GitLab CI variables. Drone wins when you want minimal ops overhead and CI agents on your own VPS. GitLab wins for all-in-one shops. For Nepal agencies, a Drone server on cheap hardware often beats per-seat SaaS fees as client repos multiply.

GitHub Actions lives inside GitHub with a large marketplace and lower ops burden on github.com, but SaaS free tiers cap minutes. Drone fits when you already use GitHub or GitLab yet want runners on a VPS you control. Pipeline YAML travels with the repo without importing an entire platform—you patch server and runners yourself, trading labour for predictable cost. For Laravel shops, Composer install, Pest runs, Vite 8.x asset builds, and Deployer-style webhook deploys map cleanly. Protect your default branch and require Drone status checks before merge, the same gate you would set on any CI engine.

Create an OAuth application on your Git provider before starting the server. On GitHub, go to Settings → Developer settings → OAuth Apps and set the callback URL to https://your-drone-domain/login. It must match DRONE_SERVER_PROTO and DRONE_SERVER_HOST exactly—a trailing slash or HTTP versus HTTPS mismatch causes login loops that fail silently. GitLab follows the same pattern under Admin → Applications. Pass credentials into DRONE_GITHUB_CLIENT_ID and DRONE_GITHUB_CLIENT_SECRET, or GitLab equivalents. Set DRONE_USER_CREATE with your username and admin:true so the first login is not a race for admin rights.

Add secrets in the Drone UI under Repository Settings → Secrets and reference them in .drone.yml with from_secret—never commit tokens to Git. The article's deploy step uses DEPLOY_TOKEN this way for a webhook to your release script on the app server. Use short-lived deploy keys, scoped API tokens, and separate secrets per environment, the same discipline as GitLab CI variables or GitHub Secrets. Enable Drone's mask behavior and avoid echo debugging that prints tokens into build logs. I apply this rule on every production Laravel application regardless of which CI engine runs the pipeline.

RPC secret mismatch leaves runners offline—verify identical strings on server and runner. OAuth callback typos break HTTPS login. Mounting the Docker socket on shared runners lets any pipeline reach the host; isolate build VMs per client or use Kubernetes runners for untrusted code. Missing when blocks fire deploy steps on every feature branch. Debug echoes leak secrets into logs. DRONE_RUNNER_CAPACITY set too high lets parallel npm and Composer jobs OOM the runner. Malformed YAML blocks the entire pipeline parse, so validate before push. Keep a staging repo that mirrors production permissions but deploys to a sandbox vhost first.

Drone supports volumes and cache plugins—mount Composer cache between runs to cut minutes off dependency installs on every push. For database-backed tests, wire a MySQL 8.4 service container in a separate pipeline or use SQLite in memory for unit suites only. Run migrations in a dedicated step when integration tests need a fresh schema, after unit tests pass—Drone's sequential default makes that ordering natural. Set DRONE_RUNNER_CAPACITY conservatively so parallel jobs do not exhaust runner RAM. Add cache volumes early; slow builds become ops debt quietly after your first green pipeline.

Not for multi-tenant or client workloads without hardening. The default Docker runner requires /var/run/docker.sock access, meaning any pipeline can mount host paths and affect the host. Isolate build VMs per client or team rather than sharing one runner across untrusted code. Advanced teams add runner labels such as platform:linux and target steps with node selectors, mirroring GitLab runner tags. Drone's simplicity exposes this risk quickly because there are fewer moving parts to hide misconfiguration—I have seen the same pattern on every client migration from manual FTP deploys to any CI engine.

Rewrite Jenkinsfile stages as Drone steps with equivalent container images—for example php:8.3-cli for PHP jobs and node:26-bookworm for asset builds. Move Jenkins credentials into Drone repository secrets and reference them with from_secret. Run both systems in parallel on a non-production repo until build and deploy parity is proven, then retire Jenkins jobs one at a time rather than big-bang cutover. Drone's YAML and Docker executor model maps stage-for-stage to most Jenkins Docker agents. The rewrite is tedious but predictable, and parallel running catches OAuth, runner, and secret gaps before you touch production repos.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: