Kegberry/Kegbot New Installation

Hello everyone,

I’m in the process of installing a bar in my basement including a built-in Kegerator. I also really want to run some sort of tap monitoring solution and stumbled on the Kegbot project. I also really liked the Kegberry version of the project, so I started the process of installing Kegberry on a new Raspberry Pi 3 (Model B). Like many of you who have attempted this recently, the installation did not go smooth! So I decided to dive in and try to get a working installation of Kegberry on the new Pi3, and I was successful! I’ll share the process and links to my updated files below. It’s not the cleanest project and I’ll hopefully try to generate a one-command install, but for now here’s the process to follow if you want to get Kegberry running on a Raspberry Pi 3.

NOTE: It helps if you have some Linux/Pi experience but hopefully the steps below are easy enough to follow. I’ll try to help out as needed as well.

  1. Download a copy of Raspbian Jessie (
  2. Unzip the file and you should be left with a single file with a .IMG extension
  3. Flash the image to a fresh MicroSD Card formatted as FAT32 using an Image Writing program. My personal favorite is Etcher (etcher .io)
  4. Insert the MicroSD card into the Pi and power up. You should have it connected to a TV/Monitor with a Keyboard and Mouse connected. You may be able to do this remotely through SSH but that’s outside the scope of these instructions.
  5. After expanding the file system and rebooting, you should be looking at the Raspbian Desktop.
  6. Make sure you are connected to the internet, either wired or wireless.

7. Update your Keyboard Layout to your country, the default is English (UK). Example here is for USA.

  • Open a terminal window and type sudo raspi-config
  • Choose: Option 4 - Localization Options
  • Choose: Change Keyboard Layout
  • Keep the default 105-Keyboard selected
  • Choose: Other
  • Choose: English (US)
  • Scroll to the top of the list and select English (US) again
  • Press ENTER several times to accept the defaults and you will be taken back to the home config screen
  • Select

  1. Open the Chromium browser and download from Google Drive at: This should place the download in your home Downloads directory. If you choose another location you may have to modify the following instructions. This package does not contain any feature/functionality updates, it just uses the latest versions of all of the packages and solves the issue you’ll run into with step 11.
  2. In a terminal window, type sudo unzip ~/Downloads/
  3. Next, type sudo mv /home/pi/Downloads/mypkgs /home/pi/
  4. Run the command bash -c ~/mypkgs/ . This will take awhile AND IT WILL FAIL! You should see an error message from urllib2 about SSL being required.
  5. Run the command bash -c ~/mypkgs/
  6. Run the same command from step 11 bash -c ~/mypkgs/ . This command should now succeed, and you’ll have the Kegbot Server running at your local IP or localhost .

I hope this gets folks up and running on their Raspberry Pi 3. I have yet to integrate the Flow Meters/Temperature sensors but I’ll update this post with my progress and any issues/troubleshooting that I have to work through in order to get a working configuration. If I can get a sample size of larger than just myself, I can hopefully put this into a single script that can be run in one command from the terminal.

If you have any questions/issues with the steps above please let me know.


Thanks! Have been able to connect the flow meter to the Arduino and that to the pi 3?

Hey, yes I was able to get that working, although to be honest I went out and got an Android tablet so I’m running things the “traditional” way with an Arduino setup connected to the tablet and talking to the Kegbot Server running on the pi3.

However, prior to getting the tablet, I was able to get the Arduino with flow meters talking directly to the PI.

1 Like

Hello everyone,

I wanted to follow-up my previous post now that I have everything working in a semi-production fashion with a full write-up on my Kegberry setup. I’ll try to break this into a few sections with regards to setting up the software and hardware, as well as a parts list for the things that I’ve used to get up and running. There’s still some modifications and clean-up to do with my setup as well as some additional features that I would like to implement, but so far I’m really pleased with how things are performing.

Component List
Let me start by listing everything I’m currently using to put this system together, with some links if I still have them to where you can get some of the components.

  • Raspberry Pi 3 Model B – I got mine from a local MicroCenter but available on Amazon
  • Raspberry Power Supply – The PI takes a lot of current, so I recommend getting a dedicated power supply, or at least use one that can output 2.5A. Link:
  • Arduino Nano – I purchased mine from Amazon and specifically looked for one that used an FTDI chip for USB vs. cheaper clones that use a CH340 chip. The CH340 devices do seem to work but I had some reliability issues. The one I got also had pre-soldered pins for connection to a breadboard. Link:
  • Small Breadboard – 30-row breadboard for holding the Arduino. Link:
  • RJ45 Breakout Board – I used a pair of these to connect an Ethernet cable from the inside of the kegerator to my Arduino. Link:
  • 14’ Flat Cat-6 Cable: This cable doesn’t need to be flat, but since this cable is between the top of my kegerator and the underside of my countertop I needed it to be very low-profile. Link:
  • Adafruit Flow Meter: I’m currently using 2 of the very inexpensive Adafruit flow meters for my installation. Link:
  • ½” female to ¼” barb 316 Stainless Steel Fittings: These are used to connect the flow meters to my beer lines. Link:
  • Plumbing Thread-Tape: used to help seal the threads between the SS fittings and plastic flow meters. Available at any hardware store.
  • Hose Clamps: Hold the beer lines onto the fittings. They already fit tight but these are cheap insurance. Available at any hardware store.
  • DS18b20 Temperature Sensor: I use this to report temperature back to Kegberry to display my kegerator temperature. Link:
  • 4.7k Resistor: Required by the DS18B20 temperature sensor for proper operation. I had one of these on-hand but should be available for pennies at an electronics retailer or online.

Raspberry Pi OS and Kegberry Installation
To get the software setup on my device, I followed the steps in my previous post exactly. Prior to running any installation scripts you should run the following terminal commands which I missed in my previous post:

  • Sudo apt-get update
  • Sudo apt-get upgrade

This will refresh the list of packages and then upgrade the existing packages on the pi to the latest available for the Raspian distribution. I’m not sure if this is 100% required, but I have always run these prior to installing Kegbot.

The rest of the instructions should still work well for getting things up and running from a fresh installation of Raspian Jessie available in the link in the original post.

Some other things I have done on the OS side are to enable SSH connectivity through the sudo raspi-config command > Interfacing Options. I also changed the default password for the “pi” login account by running the passwd command and following the prompts.

Finally, in order to easily access my server, I set a static IP address on the wireless interface of the Raspberry Pi by editing the file /etc/dhcpcd.conf and adding the following lines at the bottom. This information will be unique to your local network.

Interface wlan0
static ip_address=
static routers=
static domain_name_servers=

You will need to at least connect your pi to your wireless network, preferably using the desktop GUI. If you are using a wired connection, just replace “wlan0” with “eth0” to set a static IP on the wired interface.

Kegbot Server Setup
Kegberry is just Kegbot Server designed for the Raspberry Pi that also includes some utilities for monitoring taps and temperature. Therefore the setup is almost exactly the same as the documentation for Kegbot Server, but a lot of the legwork has already been done for you. Once the installation is completed, simply navigate to the IP address of your Raspberry Pi or “localhost” and you should be prompted to go through the configuration wizard. There are only 2 other things you may want to do to complete the setup outside of the Wizard.

  1. Setup E-mail Notifications
    Configuration settings for Kegbot Server are located in /home/kegbot/.kegbot/ In order to configure e-mail, add the following lines.

EMAIL_BACKEND = ‘django.core.mail.backends.smtp.EmailBackend’
EMAIL_HOST_USER = ‘[your email]
EMAIL_HOST_PASSWORD = ‘[your gmail password]’

This configuration is if you are using GMAIL, you will have to replace some of the values if using another email service.

  1. Fix broken image links
    For some reason after configuring email, my images disappeared from the Fullscreen view and other areas of the website. To resolve this, I added the following to /home/kegbot/.kegbot/

KEGBOT_BASE_URL = ‘http://[ip address of pi]/’

NOTE: After all changes, you will need to reboot the Pi for the changes to take effect.

Arduino-based Kegboard Setup

You will first need to download the Arduino IDE as well as download the github repository from . After unzipping the archive to a kegboard-master folder, you will need to move the folder to the Sketchbook Location directory of the Arduino IDE specified under File > Preferences. Once you’ve moved the entire folder into that directory, you should see the sketch available to open by clicking File > Sketchbook. You should be able to expand to locate the kegboard sketch under the Arduino folder.

In order to successfully flash the kegboard firmware, you will need to select the appropriate COM port and device type of your Arduino board. Also, check the file kegboard_config.h. This is where all of the pin definitions are setup, so ensure that the pins you are going to use for the Flow Meters and other sensors are setup appropriately. The Flow Meters are required to be on pins that support interrupts. The creators of Kegbot did a great job pre-configuring the pin assignments for most boards, but keep that in mind if you plan on changing where things are connected. My Arduino Nano only has 2 interrupt pins (2 and 3) so my flow meters are connected to those 2 ports.

If you are using a temperature sensor, you will have to connect a 4.7k resistor between the 5V line and the signal line of the sensor. A good diagram of how this looks can be found here:

For my setup, I just decided which wires in my Cat-6 cable would carry 5V, Ground, and the Flow0, Flow1, and temperature signals. Once I decided that, I was able to connect the appropriate pins on one RJ45 breakout board to the appropriate Arduino inputs, and wire the sensors to the correct pins on the opposite RJ45 breakout.

Once you’re happy with the settings in the Arduino IDE (you really shouldn’t have to touch anything), flash the firmware to your Arduino. Once completed, open the Arduino Serial Monitor (Tools > Serial Monitor) and set the baud rate to 115200. You should see “Hello” packets every few seconds from the board with some gibberish characters after each line. If you have a temperature sensor installed, you should also see “thermo-“ messages displayed every few seconds. Finally, if you have a flow meter connected, you should be able to blow into the sensor and observe the rapid “flow0” or “flow1” messages being generated.

Flow Meter Hardware Setup
Installing the flow-meters is pretty straight-forward. Using the thread-tape, I wrapped it around the flow meter 3 times, and then screwed on the stainless steel fitting as tight as I could get it with an adjustable wrench without going to the point where I thought I might crack the plastic. I cut the line about 18 inches above the keg coupler and inserted the flow meters, being sure to observe the correct flow direction arrow on the side of the meter.

My beer lines are about 6ft long with inner diameter of 3/16”, so the ¼” barb fittings were very tight. I solved the issue by using a heat-gun to warm up the end of the tube so that it would easily slip onto the fitting creating a tight seal. You can also use a hair-dryer or dip the end of the tube in boiling water for 15-20 seconds to soften it. I then installed metal hose clamps on all of the connections.

I installed all of the flow meter hardware in between changing kegs, so once everything was installed I used my preferred beer line cleaner to flush, clean, and sanitize the lines including the flow meter and fittings. This also served to check for leaks which I was relieved to see there are none.

Testing it out
After getting everything connected, I booted up the Raspberry Pi without the Arduino connected and logged into the Admin console and pulled up the “Controllers” screen. I then connected the Arduino to the Raspberry Pi via one of the USB ports. I refreshed the “Controllers” screen several times over the course of about 30 seconds, and finally the page displayed that there was one kegboard connected with 2 flow meters. (NOTE: at one point in testing I was never able to get the kegboard to show up. I completely started from scratch and re-flashed the OS and re-installed Kegberry and it then worked fine. Not sure what happened but keep this in mind if for some reason the controller does not show up).

I was also able to go to the configuration page of one of the taps and see that the system had discovered a temperature sensor and that it had reported a value a few seconds ago.
I then finally tapped a fresh keg, and thankfully the system successfully recorded the activity!

After getting everything installed, I used a Pyrex measuring glass to pour a beer and compare the number of ounces actually poured to what was recorded. With a couple of calibration pours, I actually settled on a value of exactly 1.0 on the “ticks per mL” value. I know Adafruit specs say that the meter should be 450 ticks per L (0.45 ticks per mL), but I guess with the small diameter fittings the reading changes. It seems to be very accurate and consistent now though with that setting but your settings may vary.

Software Modifications

  1. Full Screen Display of ABV/IBU information.
    One of the pieces of information I wanted to make visible on the Full Screen (aka taplist) view was the ABV and IBU values of the current beer. These values can be recorded on the Beer Styles pages, but aren’t displayed. I solved this by adding a few lines to the HTML file for the Full Screen page. The file is here: /home/kegbot/kegbot-server.venv/lib/python2.7/site-packages/pykeg/web/kegweb/templates/kegweb/fullscreen.html. And I added the following lines directly above the line that says {% if beverage.description %} with some HTML tags for formatting.

ABV: {{ beverage.abv_percent }}%     IBU: {{ beverage.ibu }}

  1. Resolving Phantom Pours
    After the installation, I was regularly seeing “phantom” pours on my system at all hours which I believe was caused by beer moving in the lines or EMI from the compressor kicking on/off. These pours were almost always about 0.5oz, and very rarely just under 1oz. I was able to find a setting in the configuration files that sets a minimum volume to actually trigger a pour, and it was set to 10mL (about 0.33oz). I edited the value to be 35mL (about 1.18oz) and that has completely eliminated any phantom pours.
    You can find the setting in the file /home/kegbot/kegbot-pycore.venv/lib/python2.7/site-packages/kegbot/pycore/ under MIN_VOLUME_TO_RECORD.

FAQ & Other Info

  1. Why Kegberry instead of Android + Kegbot Server
    My main issue with this installation was that with my under counter kegerator installation I don’t have a good way to setup a permanent Android tablet on the countertop without a lot of exposed wires which I didn’t want. I’m sure I could engineer some solution, but it was easier and cleaner to route everything in the bottom cabinets and just use a web browser or the Kegbot App to display the tap list and pour stats, while just having Kegberry do the actual monitoring.

  2. Beer Foam
    When I first connected the flow meters to a fresh keg my pours came out as almost all foam. I was extremely disappointed and close to just scrapping everything. However, after talking with a few other Kegbot users it was suggested to lower my CO2 pressure. Previously I was running about 12psi on my 2-tap system. I dropped that to about 6-8psi and saw a HUGE improvement. Also, my initial installation used a different collection of fittings to adapt the hose to the ½” NPT fittings of the flow meters. Installing the ¼” stainless barb fittings simplified the connections and also made a huge reduction in foam. Things are pretty much perfect now with 6-8psi and a kegerator temperature of about 38 F.

  3. More than 2 Flow Meters
    I have not set this up or tested this as I only have 2 taps on my setup, but this is certainly possible and there are multiple ways to accomplish this. First, the easiest way would probably be to use an Arduino Mega board ( These boards have 6 interrupt pins so you can connect up to 6 flow meters directly and feed them in via the single connection to the Raspberry Pi. The Arduino Code already supports these boards and correctly sets up the pin assignments. I have not done this or tested it, but it should work well.
    The other option is to connect multiple Arduino Nano boards (or similar Arduino Uno) that support 2 flow meters each. I believe you can edit the definition for the Kegboard name in the kegboard_config.h file to uniquely identify each board. The RPi 3 has 4 USB ports so you should be able to connect 4 Arduino boards (8 flow meters) and even more if you use some type of USB Hub. Again, I have not tried this or tested this but it should work just fine.

  4. Future Enhancements
    One thing I’m going to try to setup in the future is an easy tablet-friendly way of re-assigning or claiming pours from the Full Screen display of Kegbot Server. I’m happy to have Kegberry just recording pours and keg volumes behind the scenes when I’m just drinking by myself, but for parties or gatherings I would love to setup the attractive tap list view with the additional ability for known users manually log pours within the Kegberry system.

  5. I’m having problem [insert problem here] with Kegberry
    If you’re having issues getting setup, feel free to reach out and I’ll try to help as best I can! The most common issue I’ve seen is people trying to use one of the later versions of the Raspbian operating system. The latest version that Kegberry supports is the “Jessie” version, so follow the instructions in the first post to get the correct image and get things going.

I will of course try to help any respond to any issues you may have or questions, but hopefully this write-up helps some people get the system up and running! Here’s a few mediocre pictures of my setup.

The Bar

Flow Meter connected inline with Stainless Steel fittings & Hose Clamps

RJ45 Breakout Board soldered with connections for Flow Meter 0 (Green), Flow Meter 1 (Red - not connected), and Temperature Sensor (Blue)

Arduino (Green LED) board connected to RPi via USB. Cat-6 Cable runs through the cabinet and up and into the Kegerator through the cutout for the tower.


Great write up man, this should help new kegbot enthusiasts!


I just got through the initial setup on a Arduino MEGA and minus a few hiccups on the Pi setup, everything is working as it should with 4 flow meters.

I think the main dashboard could use some work, but I code in django/python all day, so I think I am going to update a few things. I’ll share what I end up with!

Thank you for the detailed walkthrough, that was an immense help!


Awesome, I’m glad it was helpful!!

Please share what you come up with! I’ve made some modifications myself:

  • Updated the “Fullscreen” view with a picture of the user that last poured and time/amount rather than the picture of the keg
  • If the last pour was a “guest” pour, the fullscreen tap list shows a button that links to the Edit Drink page to assign that pour to a user
  • Added the ability to add a “SHOUT” to a drink via the drink edit screen
  • Added a link to the fullscreen page to the Navbar at the top of the screen

My next project, if I get the time, would be to try to implement web-sockets so that if you view the tap list from a browser and someone starts a pour, you could immediately see a counter next to that tap counting the OZ poured. If you’re a python/django wizard @Cyrisx2 maybe you can help with this. I’ve looked into Django Channels but haven’t spend much time with it.

Great to see another developer taking interest in this!!

1 Like

Thanks for all the awesome info… made the install so easy. Have 2 flow meters connected via arduino Uno board and works like a charm. Just a question (2) … is there a way to change to the Metric units ? I can change it on the kegberry server side of things, but still shows the pours in ounces on the kegbot app. Is there any alternatives/updates/ mods on the android app side…? showing last poured ext ext …
Im still deciding if i should settle on on Kegberry or Raspberrypints… RaspberryPints looks prettier to me on the front end,but I prefer some of the functions of the kegberry, esp that you can add users and monitor their Booze-ups :wink:

Anyway thanks again for all the effort you guys put into it…Will follow the thread closely.

Hi @Necro,

In the Android App I was able to change the settings by tapping the three-dots in the upper-right corner of the screen and selecting “Settings”. Under the General tab, there is an option for “Use Metric Units” which seemed to work well for me both on the main screens (Liters Poured/Liters Left) as well as on the Active Pour screen (mL poured).

Thanks Johnnyruz… Used a samsung Tablet… the 3 little dots dont come up for some reason…I could see it with the kegbot app on the Phone.
Having endless problems tho on server side… think I will format and give it one more try… Pours register fine… but always register pours as Guest… even when I select another User.

@Necro, I’ll test tonight and see if I can replicate the issue with my tablet

@johnnyruz - Man, I was so excited to get this thing hooked up, but now disappointed. I am having full pints of foam. I’ve tried lowering the PSI, but that isn’t helping much. I used these these flowmeters thinking that the small input/output and size would lead to less foam because there wasn’t as much expansion as the bigger ones, but it is doing a great job of making beer froth for me.

I’m going to try to lengthen lines, move the flowmeter closer to the faucet, etc, but I’m pretty bummed so far.

Fresh Jessie install, but still not able to link pours to drinkers… all the pours register as guest… Not sure what to do… could it be the android device I’m using ?
Pours register, but if i try and do calibration it does not detect flow, so can’t calibrate. Is there a file I can tinker with to do it manually? this is the meter Im using so 1420/L.

I am having a problem with the recommended booting up on a pi 3B+ any suggestion would be appreciated

Hi @danc,

I’ve also heard that the older jessie images have issues on the new B+ models. Something with a different hardware architecture.

I have a B+ that I have not yet loaded Kegbot on, but I’ll give it a try tonight or tomorrow and see if I can come up with a suggestion or work-around.

Thank you for the response

Alright, so I finally got the installation working on a Raspberry Pi 3 B+ running Raspbian Stretch OS. The instructions are a little crazy and I may try to script this out so it’s easier, but in the meantime here we go!

Standard Pi Setup Stuff

  1. Flash the latest Raspbian Stretch, either Lite or with Desktop will work
  2. Boot the PI+
  3. Resize will Happen Automatically and then reboot
  4. Pi will then start up
  5. Login with pi/raspberry
  6. Run: sudo raspi-config
  7. Reset your password (optional)
  8. Turn on SSH under Interfacing Options
  9. Change keyboard layout if necessary (defaults to English UK)
  10. Connect to WiFi by selecting country, entering SSID, and password (not required if using a network cable)
  11. Run ifconfig to get the IP Address of your Pi (either eth0 interface (wired) or wlan0 (WiFi)
  12. Exit raspi-config
  13. Run sudo apt-get update
  14. Run sudo apt-get upgrade

The rest of these steps can either be performed via the attached keyboard/mouse or over SSH. I prefer SSH so you can scroll up/down to see historical messages.

Get My Updated Kegbot Packages and Scripts

  1. Download my packages into your home directory by running:
  2. You should have a file in the folder /home/pi/
  3. Unzip by running unzip
  4. You should now have a folder at /home/pi/mypkgs
  5. Execute the command: bash -c /home/pi/mypkgs/

Fix issue with missing Six module and libmysqlclient-dev

  1. After running the install script for the first time, the installer should fail with message

ImportError: no module named six

  1. Run the command sudo pip install six
  2. Next, open the file located at /usr/local/lib/python2.7/dist-packages/kegberry/
  3. Find the section for REQUIRED_PACKAGES, and change the entry for libmysqlclient-dev to default-libmysqlclient-dev
  4. Execute the command bash -c /home/pi/mypkgs/

Fix issue with MySQL/MariaDB Permissions & Index

  1. After running the install script for the second time, the installer should fail with message

Permission denied for user ‘root’@‘localhost’

  1. Open the file /etc/mysql/mariadb.conf.d/50-server.cnf
  2. In the [mysqld] section at the top of the file, find the line that says “skip-external-locking” and add the line skip-grant-tables directly below that
  3. Scroll down and find the two lines for character-set-server and collation-server
  4. Change these lines to the following:

character-set-server = utf8
collation-server = utf8_general_ci

  1. Reboot your Raspberry Pi
  2. After the reboot, execute the command bash -c /home/pi/mypkgs/

Fix issue with SSL Package Repository

  1. After running the install script for the 3rd time, the installer should fail with message

HTTP Error 403: SSL is required

  1. Execute the command bash -c /home/pi/mypkgs/
  2. After this finishes, again run bash -c /home/pi/mypkgs/

Wrapping Up

On my Pi, this final step took a long time, but I have a very slow internet connection which may impact things. But once it completes you should have a fully functioning Kegberry installation.

Kegboard Controller Issue

User @danc discovered an issue with the Kegbot Server’s auto-discovery of controllers when connected via USB to the Raspberry Pi. I tracked this down to an issue with the pycore-flags.txt file located at /home/kegbot/.kegbot/pycore-flags.txt

You will need to make sure that the contents of this file look exactly like the following, but with your own API key:


You should only have these two lines (including the double-dashes in front) with no additional text in the file.

Wrapping Up

Please let me know if this works for you, and if any linux masters out there can turn this into a stand-alone script that would be awesome for future users.


After step 5 in get my updated keg bot packages and scripts I get a message permission denied


Are you getting a permission error trying to download the packages from Github, or in step 5 in that section where you’re running that install script for the second time?

Feel free to copy and paste the error message/screenshot and I’ll try to help out!

pi@raspberrypi:~ $ bash -c /home/pi/mypkgs/
bash: /home/pi/mypkgs/ No such file or directory
pi@raspberrypi:~ $ bash -c /home/pi/my_kegbot_packages/mypkgs/
bash: /home/pi/my_kegbot_packages/mypkgs/ Permission denied
pi@raspberrypi:~ $

this is a copy of the message i get
thanks for the help