How to Install Drone on Debian Latest
Drone is a popular open-source Continuous Integration and Continuous Deployment (CI/CD) platform utilized for automating the software delivery workflows. In this tutorial, you will learn how to install Drone on Debian latest version.
Prerequisites
Before starting the installation process, you will need the following prerequisites:
- A running Debian latest server
- A root user or a user with sudo privileges
- Access to the internet to download the required packages
Step 1: Update the System Packages
Before installing the Drone, ensure that the system packages are up to date by running the following command:
sudo apt update && sudo apt upgrade -y
Step 2: Install Docker
Drone requires Docker to be installed on the host machine. Follow these steps to install Docker on your system:
- Install the Docker dependencies using the command:
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common -y
- Download the Docker GPG key:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
- Add the Docker repository to the APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
- Update the APT package index:
sudo apt update
- Install the Docker Community Edition:
sudo apt install docker-ce -y
- Start and enable the Docker service:
sudo systemctl start docker && sudo systemctl enable docker
You can verify the installation and enablement of Docker using the command:
sudo systemctl status docker
Step 3: Install Docker Compose
Drone requires Docker Compose to be installed on the host machine. Follow these steps to install Docker Compose:
- Download the latest Docker Compose version:
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- Make the downloaded file executable:
sudo chmod +x /usr/local/bin/docker-compose
- Create a symbolic link to the Docker Compose executable:
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
Verify the Docker Compose version using the command:
docker-compose --version
Step 4: Install Drone
Now that you have Docker and Docker Compose installed on your system, it's time to install Drone. Follow these steps to install Drone:
- Create a new directory for Drone:
sudo mkdir /opt/drone && sudo chown -R $USER:$USER /opt/drone
- Create a new Docker Compose file for Drone:
nano /opt/drone/docker-compose.yml
- Paste the following code into the file and save it:
version: '3'
services:
drone-server:
image: drone/drone:latest
ports:
- 80:80
- 443:443
volumes:
- ./data:/data
- /var/run/docker.sock:/var/run/docker.sock
restart: always
environment:
- DRONE_SERVER_HOST=<YOUR_SERVER_IP>
- DRONE_SERVER_PROTO=http
- DRONE_RPC_SECRET=<YOUR_RPC_SECRET>
drone-runner:
image: drone/drone-runner-docker:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: always
environment:
- DRONE_RPC_HOST=<YOUR_SERVER_IP>
- DRONE_RPC_PROTO=http
- DRONE_RPC_SECRET=<YOUR_RPC_SECRET>
Note: Replace
- Launch the Drone stack using the Docker Compose command:
docker-compose up -d
You can verify the installation of Drone by accessing the Drone Web Interface via a web browser by typing:
http://<YOUR_SERVER_IP>
Conclusion
In this tutorial, you learned how to install Drone on Debian latest version. With Drone installed, you can now start automating the testing and deployment of your software. Happy coding!