I am just a hobbyist when it comes to mining. There was not a complete tutorial on how to setup the GekkoScience 2-Pac to mine coins. I gathered the info and compiled this tutorial from watching videos and reading from various forums and websites. All credits to the OPs are linked at the bottom of this tutorial. If you need help after completing this tutorial, comment below.

I gather you have a Raspberry Pi (with Raspbian on a MicroSD) and a GekkoScience 2-Pac. If you have more than 2, it's best if you use a powered USB hub.

Here are the instructions step by step. You can either use a connected keyboard and mouse with the RPI or you can enable ssh.


  1. Enable SSH
    1. Launch Raspberry Pi Configuration from the Preferences menu
    2. Navigate to the Interfaces tab
    3. Select Enabled next to SS
    4. Click OK
  2. To login to the RPI via SSH, you must have an SSH client on your computer. An easy client is called PuTTY and is available for Windows, Mac, and Linux.
    1. Open PuTTY on your computer and put in the local IP address of your RPI. You will be prompted to input the default username (pi) and password (raspbian). The remainder of the commands can be done either by terminal on the RPI or SSH connection.

Let's Get Started:

  1. Install Apache 2 Webserver and PHP
    1. Copy and execute the following command to install Apache2.
      sudo apt-get install apache2 -y
    2. Copy and execute the following command to install PHP.
      sudo apt-get install php libapache2-mod-php -y
    3. Copy and execute the following code to install PHP CLI, PHP cURL, Redis, Screen and Git.
      sudo apt-get install redis-server git screen php7.0-cli php7.0-curl -y
  2. Install Minera to /var/www/html
    1. Copy and execute the following command to change directory to the webserver root.
      cd /var/www/html
    2. Copy and execute the following command to clone Minera from github.
      sudo git clone https://github.com/getminera/minera
    3. cd into the Minera folder.
      cd minera
    4. Copy and execute the following command to install Minera. (If prompted, leave all options at default.)
      sudo ./install_minera.sh
  3. Update the Repositories and Upgrade Raspbian on the RPI before going to the next step.
    1. Copy and execute the following command to Update the Raspbian Repositories.
      sudo apt-get update
    2. Copy and execute the following command to Upgrade Raspbian.
      sudo upgrade -y
  4. Compile and Install cgminer with the correct drivers for the GekkoScience 2-Pac.
    1. Copy and execute the following command to install the necessary dependencies.
      sudo apt-get install -y build-essential git libusb-1.0-0-dev libusb-1.0-0 libcurl4-openssl-dev libncurses5-dev libudev-dev screen libtool automake pkg-config libjansson-dev
    2. Copy and execute the following command to create a work folder and cd to that folder.
      sudo mkdir -p ~/git/vthoang; cd ~/git/vthoang
    3. Copy and execute the following command to clone the forked cgminer repository with the driver for the 2-Pac.
      sudo git clone https://github.com/vthoang/cgminer.git
    4. Copy and execute the following command to cd to the cgminer folder.
      cd cgminer
    5. Copy and execute the following command to set flags and enable the 2-Pac drivers.
      sudo CFLAGS="-O2" ./autogen.sh --enable-gekko
    6. Copy and execute the following command to compile cgminer.
      sudo make -j 2
    7. Copy and execute the following command to copy cgminer to the custom miner folder for Minera.
      sudo cp cgminer /var/www/html/minera/minera-bin/custom/cgminer-vthoang
  5. Configure Minera to mine.
    1. Open and point the browser on the RPI to localhost or the local IP address of the RPI from your computer.
      (RPI IP Address)/minera
    2. Log into Minera using the default password (minera).
    3. In the left menu, click on Settings then Custom Miners.
    4. Enable your custom miner, cgminer-vthoang.
    5. Under Local Miner Settings, select your custom miner, cgminer-vthoang. Enable logging and Append JSON conf.
    6. Under Pools Settings, configure your pool. Make sure your new pool is the first option by dragging it above or removing the donation pool. (You must have a wallet and a pool account for the coin you're going to mine. (ex. SlushPool, TheCoin.pw, etc.)
      Some pool accounts require you to set up a worker before you start mining. You will usually use enter username.worker as the Pool Username and literally, anything, as the password unless otherwise specified by the pool Readme or Getting Started.
    7. Plug your 2-Pac into your RPI. Click Save & Restart Miner.

If everything was set correctly, the light on your 2-Pac should start blinking and you can see what your 2-Pac is mining by Playing the Log on the Dashboard or view your worker hashrate on the pool website.

You can overclock your 2-Pac. A powered USB Hub is required. Be careful because the 2-Pac chips will get very hot and you must have an adequate heatsink and/or fan. The following command can be used to overclock the 2-Pac. (You can increase the frequency of the 2-Pac from 50 to 500 in increments of 25.)
--gekko-2pac-freq 150

I overclock mine to 175 and only use a USB fan pointed at them. I assume no liability for damages if your 2-Pac overheats!

Be sure to Like and Share this tutorial by the links below and comment if you need any further assistance.

YouTube - GekkoScience 2Pac 11gh/s+ Raspberry PI 3b video by Brian Schott

RaspberryPi.org - Download Raspbian for Raspberry Pi

RaspberryPi.org - Setting up an Apache Web Server on a Raspberry Pi - Raspberry Pi Documentation

Minera Github - getminera/minera: Minera is a web interface to monitor and manage mining devices

Forked cgminer Github - vthoang/cgminer: ASIC and FPGA miner in c for bitcoin