How to install Drone on OpenBSD

Drone is a Continuous Integration (CI) and Continuous Deployment (CD) tool that helps automate software testing and deployment processes. In this tutorial, we will show how to install Drone on OpenBSD.

Before you begin

Before installing Drone on OpenBSD, ensure that:

  1. You have a working OpenBSD installation on a server or virtual machine.
  2. You have root access to the server or virtual machine.

Steps

  1. Login to your OpenBSD server as root or a user with sudo privileges.

  2. Update your system using the following command:

    sudo pkg_add -u
    
  3. Install the required packages using the following command:

    sudo pkg_add git go py-pip sqlite
    
  4. Install Docker by following the instructions in the official Docker documentation for OpenBSD: https://docs.docker.com/install/linux/docker-ce/openbsd/

  5. Create a new system user for Drone:

    sudo adduser drone
    
  6. Install Drone CLI:

    sudo curl -L https://github.com/drone/drone-cli/releases/latest/download/drone_openbsd_amd64.tar.gz | sudo tar zx -C /usr/local/bin
    
  7. Download and extract the latest version of Drone Server:

    wget https://github.com/drone/drone/archive/v1.9.0.tar.gz
    tar zxvf v1.9.0.tar.gz
    
  8. Change into the Drone directory:

    cd drone-1.9.0/
    
  9. Build the Drone server binary:

    make build
    
  10. Install the Drone server binary:

sudo install -t /usr/local/bin drone
  1. Configure Drone by creating a configuration file at /etc/drone/drone.toml with the following content:
[server]
host = "drone.example.com"
port = ":80"
proto = "http"

[database]
driver = "sqlite3"
datasource = "/var/lib/drone/drone.sqlite"

[smtp]
host = "smtp.gmail.com"
port = "587"
from = "example@gmail.com"
username = "example@gmail.com"
password = "password"

[acme]
email = "example@gmail.com"
domains = ["drone.example.com"]

Replace the host, from, username, and password values with your own.

  1. Create the required directories:
sudo mkdir -p /etc/drone /var/lib/drone
  1. Change the ownership of the created directories to the Drone user:
sudo chown -R drone:drone /etc/drone /var/lib/drone
  1. Generate a Drone token:

    drone user add myusername --admin
    drone user token myusername
    
  2. Start the Docker daemon:

sudo systemctl start docker.service
  1. Start the Drone server using the following command:
export DRONE_SERVER_HOST="drone.example.com"
export DRONE_SERVER_PROTO="http"
export DRONE_TOKEN="mytoken"
export DRONE_AWS_BUCKET="mybucket"
export DRONE_DATABASE_DATASOURCE="/var/lib/drone/drone.sqlite"
export DRONE_AGENTS_ENABLED=true
export DRONE_RPC_SECRET=<SECRET>

drone server

Replace drone.example.com and mytoken with your own values.

  1. Verify that the installation was successful by accessing the Drone UI by visiting http://drone.example.com in a web browser.

You have now successfully installed Drone on OpenBSD!

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!