Using docker to install BrewPi


Messing around a bit with getting the legacy container on the same Pi that my Spark 3 is running on. Have both the Spark 3 and the Arduino plugged in to USB, so the second device is /dev/ttyACM1 as expected. When creating the container, I am storing the data in ~/brewpi-legacy. All is working, but have to find a clean way to create the ~/brewpi-legacy directories with the right permissions for a clean install.


Any suggestions on adapting the Synology / unRAID configs for use on a QNAP NAS?
Where to start? New to Docker, new to the NAS as well… Don’t really want to mess with my rpi config right now so looking for an alternative for the new build.


Noob question related to docker containers:

The BrewPi script master branch is currently at version 0.5.2, but it looks like we’re up to RC3 on the 0.5.3 branch. When the official release moves to 0.5.3, will this involve creating a new container, switching to that one, and retiring the previous container? In other words there is no longer a notion of running to do an in-place upgrade of the code?

If so, does this simply involve using ssh to do another sequence of “docker pull”, “docker stop”, “docker rm”, and “docker run”?


Both are possible. The running container can pull the latest code, or the full container can be recreated.


back at it… have a docker image up and running on my QNAP NAS using the brewpi-ubuntu:latest image.
I have a filesystem on my NAS named /brewpi-data which I’ve added as /data to the docker image.
the log files in /data/logs are showing up owned by root and the brewpi Maintenance logs UI shows “Cannot open log file /home/brewpi/logs/stderr.txt”…

looking at the processes running, I do see that the python script process is owned by “brewpi”.
Why are the logs getting created as root?

root@71dc4adb9fb5:/home/brewpi# ps -eaf | grep brewpi
root 130 1 0 03:24 ? 00:00:00 sudo -u brewpi python -u /home/brewpi/
brewpi 131 130 0 03:24 ? 00:00:01 python -u /home/brewpi/
root 143 92 0 03:30 ? 00:00:00 grep --color=auto brewpi

The /data volume contents are owned by brewpi:brewpi, but the log files were created with root:root ownership. What is wrong?

root@71dc4adb9fb5:/home/brewpi# **ls -al logs**                                                                                                                                                                                                                                                                                                        
lrwxrwxrwx 1 root root 10 Dec 21 03:21 logs -> /data/logs
root@71dc4adb9fb5:/home/brewpi# **ls -al /data/logs**                                                                                                                                                                                                                                                                                                  
total 28                                                                                                                                                                                                                                                                                                                                           
drwxrwx---+ 2 brewpi brewpi 4096 Dec 21 03:24 .                                                                                                                                                                                                                                                                                                    
drwxrwxrwx+ 9 brewpi brewpi 4096 Dec 21 03:15 ..                                                                                                                                                                                                                                                                                                   
-rwxrwx---+ 1 brewpi brewpi   70 Sep 14 21:21 .gitignore                                                                                                                                                                                                                                                                                           
-rw-rw----+ 1 root   root    401 Dec 21 03:24 stderr.txt                                                                                                                                                                                                                                                                                           
-rw-rw----+ 1 root   root   1288 Dec 21 03:30 stdout.txt
root@71dc4adb9fb5:/home/brewpi# **ls -al /data**                                                                                                                                                                                                                                                                                                       
total 88                                                                                                                                                                                                                                                                                                                                           
drwxrwxrwx+ 9 brewpi brewpi    4096 Dec 21 03:15 .                                                                                                                                                                                                                                                                                                 
drwxr-xr-x  1 root   root      4096 Dec 21 03:21 ..                                                                                                                                                                                                                                                                                                
drwxrwx---+ 2 brewpi brewpi    4096 Dec 21 02:14 .AppleDB                                                                                                                                                                                                                                                                                          
-rwxrwx---+ 1 brewpi brewpi   14340 Dec 21 02:55 .DS_Store                                                                                                                                                                                                                                                                                         
drwxrwxrwx  3 brewpi brewpi    4096 Sep 14 21:35 .streams                                                                                                                                                                                                                                                                                          
drwxrwx---+ 2 brewpi brewpi    4096 Sep 14 20:55 @Recycle                                                                                                                                                                                                                                                                                          
drwxrwx---+ 6 brewpi brewpi    4096 Sep 14 21:35 data                                                                                                                                                                                                                                                                                              
drwxrwx---+ 5 brewpi www-data  4096 Sep 14 21:08 html_data                                                                                                                                                                                                                                                                                         
drwxrwx---+ 2 brewpi brewpi    4096 Dec 21 03:24 logs                                                                                                                                                                                                                                                                                              
-rwxrwx---+ 1 brewpi brewpi       0 Dec 21 03:15 properDir                                                                                                                                                                                                                                                                                         
drwxrwx---+ 3 brewpi brewpi    4096 Dec 21 03:13 settings                                                                                                                                                                                                                                                                                          

Also seems that the symlinks to /data/* are owned by root as well. why?

brewpi@71dc4adb9fb5:~$ ls -al                                                                                                                                                                                                                                                                                                                      
total 324                                                                                                                                                                                                                                                                                                                                          
drwxrwsr-x 1 brewpi brewpi  4096 Dec 21 03:41 .                                                                                                                                                                                                                                                                                                    
drwxr-xr-x 1 root   root    4096 Dec  8 19:13 ..                                                                                                                                                                                                                                                                                                   
-rw------- 1 brewpi brewpi   197 Dec 21 03:41 .bash_history                                                                                                                                                                                                                                                                                        
-rw-r--r-- 1 brewpi brewpi  3106 Dec 21 03:41 .bashrc                                                                                                                                                                                                                                                                                              
drwxrwsr-x 8 brewpi brewpi  4096 Dec  8 19:13 .git                                                                                                                                                                                                                                                                                                 
-rw-rwxr-- 7 brewpi brewpi   539 Aug 23 09:00 .gitattributes                                                                                                                                                                                                                                                                                       
-rw-rwxr-- 7 brewpi brewpi   325 Aug 23 09:00 .gitignore                                                                                                                                                                                                                                                                                           
srwxrwxrwx 1 brewpi brewpi     0 Dec 21 03:24 BEERSOCKET                                                                                                                                                                                                                                                                                           
-rw-rwxr-- 7 brewpi brewpi 10348 Aug 23 09:00                                                                                                                                                                                                                                                                                     
-rw-r--r-- 1 brewpi brewpi 10298 Dec 21 03:21 BrewPiProcess.pyc                                                                                                                                                                                                                                                                                    
-rw-rwxr-- 7 brewpi brewpi  4302 Aug 23 09:00                                                                                                                                                                                                                                                                                      
-rw-r--r-- 1 brewpi brewpi  4208 Dec 21 03:21 BrewPiSocket.pyc                                                                                                                                                                                                                                                                                     
-rw-rwxr-- 7 brewpi brewpi  5578 Aug 23 09:00                                                                                                                                                                                                                                                                                        
-rw-r--r-- 1 brewpi brewpi  5578 Dec 21 03:21 BrewPiUtil.pyc                                                                                                                                                                                                                                                                                       
-rw-rwxr-- 7 brewpi brewpi  6402 Aug 23 09:00 LogMessages.h                                                                                                                                                                                                                                                                                        
-rw-rwxr-- 7 brewpi brewpi 10591 Aug 23 09:00                                                                                                                                                                                                                                                                                   
-rw-r--r-- 1 brewpi brewpi  8480 Dec 21 03:21 MigrateSettings.pyc                                                                                                                                                                                                                                                                                  
-rw-rwxr-- 7 brewpi brewpi   205 Aug 23 09:00                                                                                                                                                                                                                                                                                            
-rw-rwxr-- 7 brewpi brewpi  3030 Aug 23 09:00                                                                                                                                                                                                                                                                                        
-rw-r--r-- 1 brewpi brewpi  3092 Dec 21 03:21 autoSerial.pyc                                                                                                                                                                                                                                                                                       
-rw-rwxr-- 7 brewpi brewpi  7131 Aug 23 09:00                                                                                                                                                                                                                                                                                  
-rw-r--r-- 1 brewpi brewpi  5907 Dec 21 03:21 backgroundserial.pyc                                                                                                                                                                                                                                                                                 
-rw-rwxr-- 7 brewpi brewpi 38220 Aug 23 09:00                                                                                                                                                                                                                                                                                            
-rw-rwxr-- 7 brewpi brewpi  4153 Aug 23 09:00                                                                                                                                                                                                                                                                                        
-rw-r--r-- 1 brewpi brewpi  3247 Dec 21 03:21 brewpiJson.pyc                                                                                                                                                                                                                                                                                       
-rw-rwxr-- 7 brewpi brewpi  7475 Aug 23 09:00                                                                                                                                                                                                                                                                                     
-rw-r--r-- 1 brewpi brewpi  6684 Dec 21 03:21 brewpiVersion.pyc                                                                                                                                                                                                                                                                                    
-rw-rwxr-- 7 brewpi brewpi     1 Aug 23 09:00 brewpi_dontrun                                                                                                                                                                                                                                                                                       
-rwxrwxr-x 7 brewpi brewpi   551 Aug 23 09:00                                                                                                                                                                                                                                                                                     
lrwxrwxrwx 1 root   root      10 Dec 21 03:21 data -> /data/data                                                                                                                                                                                                                                                                                   
-rw-rwxr-- 7 brewpi brewpi  4796 Aug 23 09:00                                                                                                                                                                                                                                                                                  
-rw-r--r-- 1 brewpi brewpi  3653 Dec 21 03:21 expandLogMessage.pyc                                                                                                                                                                                                                                                                                 
lrwxrwxrwx 1 root   root      10 Dec 21 03:21 logs -> /data/logs                                                                                                                                                                                                                                                                                   
-rw-rwxr-- 7 brewpi brewpi  1441 Aug 23 09:00                                                                                                                                                                                                                                                                                         
-rw-r--r-- 1 brewpi brewpi   929 Dec 21 03:21 parseEnum.pyc                                                                                                                                                                                                                                                                                        
-rw-rwxr-- 7 brewpi brewpi  9198 Aug 23 09:00                                                                                                                                                                                                                                                                                           
-rw-r--r-- 1 brewpi brewpi  5097 Dec 21 03:21 pinList.pyc                                                                                                                                                                                                                                                                                          
-rw-rwxr-- 7 brewpi brewpi 21467 Aug 23 09:00                                                                                                                                                                                                                                                                                 
-rw-r--r-- 1 brewpi brewpi 18328 Dec 21 03:21 programController.pyc                                                                                                                                                                                                                                                                                
lrwxrwxrwx 1 root   root      14 Dec 21 03:21 settings -> /data/settings                                                                                                                                                                                                                                                                           
-rw-rwxr-- 7 brewpi brewpi    52 Aug 23 09:00 start.bat                                                                                                                                                                                                                                                                                            
-rw-rwxr-- 7 brewpi brewpi  2974 Aug 23 09:00                                                                                                                                                                                                                                                                                
-rw-r--r-- 1 brewpi brewpi  1562 Dec 21 03:21 temperatureProfile.pyc                                                                                                                                                                                                                                                                               
drwxrwsr-x 2 brewpi brewpi  4096 Dec  8 19:13 tests                                                                                                                                                                                                                                                                                                
drwxrwsr-x 2 brewpi brewpi  4096 Dec  8 19:13 utils                                                                                                                                                                                                                                                                                                


Also decided to try an update… Ran into some errors as well with the package dependencies and cron restart.

Please advise…

root@71dc4adb9fb5:~/brewpi-tools# python
…non-error lines omitted due to length…
*** Updating BrewPi web interface repository ***
You are on branch master
The latest commit in /var/www/html is a5a79081ee794e8070e17899ac52c27f5450634d on Tue, 18 Jul 2017 19:50:54
The latest commit on origin/master is 2282837df5f0bb171ae58302b7780d5d50d213e2 on Sat, 23 Sep 2017 08:23:28
*** Updates are available! ****
Would you like to update /var/www/html from origin/master [Y/n]: Y
Updating a5a7908…2282837
js/device-config.js | 8 +++±—
1 file changed, 4 insertions(+), 4 deletions(-)
master updated!

One our more repositories were updated, running from /home/brewpi/utils…
Installing dependencies, updating CRON and fixing file permissions…
Cleaning up BrewPi script directory…
Deleted 13 old .pyc files
Deleted 4 empty directories

***** Installing/updating required packages… *****

Reading package lists… Done
Building dependency tree
Reading state information… Done
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-cgi is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package php5-cli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:

Package php5-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package ‘libapache2-mod-php5’ has no installation candidate
E: Package ‘php5-cli’ has no installation candidate
E: Package ‘php5-common’ has no installation candidate
E: Package ‘php5-cgi’ has no installation candidate
E: Package ‘php5’ has no installation candidate


See above lines for error message
Script NOT completed

(continued in next reply… post too long)


(update output continued…)

***** Updating cron for the brewpi user… *****

sudo: crontab: command not found
Cron file is old version, starting fresh
No previous setting for scriptpath found, using default /home/brewpi
No previous setting for stdoutpath found, using default /home/brewpi/logs/stdout.txt
No previous setting for stdoutpath found, using default /home/brewpi/logs/stdout.txt
Checking entry for brewpi …

Your current cron entry:

Latest version of this cron entry:

          • brewpi python $scriptpath/ --checkstartuponly --dontrunfile $scriptpath/ 1>/dev/null 2>>$stderrpath; [ $? != 0 ] && python -u $scriptpath/ 1>$stdoutpath 2>>$stderrpath &

Your current cron entry differs from the latest version, would you like me to update? [Y/n]: Y

Adding new cron entry to file
Done checking entry brewpi …
No setting found for wifi check script
/home/brewpi/utils/ line 217: ifconfig: command not found

It looks like you’re not running a wifi adapter on your Pi.
We recently added a utility script that can attempt to restart the
WiFi connection on your Pi, if the connection were to drop.
Would you like to enable the cron entry? [Y/n]: n
Setting wifichecker to disabled
Restarting cron
sudo: /etc/init.d/cron: command not found


See above lines for error message
Script NOT completed

***** Fixing file permissions for /var/www *****

***** Fixing file permissions for /home/brewpi *****

The update script can automatically check your controller firmware version and program it with the latest release on GitHub, would you like to do this now? [Y/n]:Y
Stopping any running instances of BrewPi to check/update controller…

Checking current firmware version…
Dec 21 2017 03:59:01 Opening serial port
Found BrewPi v0.5.2 build 0.5.2-0-g72e633171, running on a Particle Photon with a V2 shield on port socket://

Current firmware version on controller: 0.5.2

Checking GitHub for available release…
Latest version on GitHub: 0.5.2
You are already running version 0.5.2.
No update needed. Exiting.
Firmware update done

*** Done updating BrewPi! ***

Please refresh your browser with ctrl-F5 to make sure it is not showing an old cached version.


Just an FYI for anyone else – I’ve spent the morning fighting hypriot using a mix of the documentation on the wiki and hypriot’s documentation.

With the current version of hypriot, they changed how the device-init works. It is now /boot/user-data on the image. A big thing to remember is that the content defined in the file is only created on the first boot. If you find that you missed a step or forgot to change something after you’ve already booted the raspberry pi, you need to make the necessary changes to the OS manually.

Another gotcha that I found people talking about with the rasberry pi 3 is that you have to edit the /boot/config.txt and set “enable_uart=0” if you want to use the wifi. Supposedly, the onboard wifi and uart use the same pins, so you can’t use both.

I used an issue reported on their github ( to figure this all out.


can you guys @fatbaldingoldgit please include me or let me know how I can help - I am literally in the process of trying to install all of it. I have the RasPi and the spark 3 connected via USB currently and the Docker App installed on the Mac and the image i downloaded or picked was brewpi omni and ubuntu (i wasn’t sure which to pick) please let me know. - @Elco lco has me on Skype so I can screen share or whatever you need along the way - happy to help


I think the install process should work as described in the wiki–it’s just the update process from docker thats a little undocumented at the moment.

From your post it sounds like you installed docker on your mac. This is fine if that’s where you want the brewpi webserver to be, but in that case you don’t need the raspberry pi. If you want the webserver to be on the pi (nice because you can keep it on 24/7 and thus log beer/fridge temps 24/7) then you need to install docker on the pi itself (or install an OS to the pi that comes pre-installed with docker). I’m going to list the basic steps below and if you let me know which one(s) you are stuck at, I’ll try to offer some more detailed guidance.

  1. install an OS of some sort on the Pi (ie. rasbian, hypriot, etc.)

  2. make note of the ip address of the Pi (and spark 3 if you want it to connect to the pi via wifi), edit your router settings so these ip addresses are both reserved for these devices.

  3. connect to the pi vi ssh OR connect the pi to a monitor and keyboard and open a terminal

  4. install docker on the pi if not already installed

  5. use docker to pull a brewpi image, I use the raspian one because it is customized for pi hardwarve (you can also pull a portrainer image as well for visual UI for controlling docker)

  6. choose whether to use USB or wifi for the pi to connect to the spark, edit docker command and config file accordingly (for USB you need to add a parameter to the docker deploy command, for wifi you need to edit a line in the brewpi config file).

  7. From your normal computer enter the ip address of the pi (from step 2) into your web browser, the brewpi UI should pop up, and if step 6 was successful, it should say “script running.”

  8. at some point you’ll likely need to update, and this is where the current docker installs seem to have a slightly different (and undocumented) workflow. So you’ll need to stay tuned on best practices for updating.

Like I said, just let us know what step(s) you are stuck on and provide some details on what you’ve tried, what happened and what you expected would happen and I can try to help out.


Well I may have gone backwards - I re-installed Raspberrypi (i did the Firmware upgrade and got a kernal panic error during boot so…) - whole OS on my SD card on the RPi3. I can ssh to it via my local network and its also booted and I can see the KDE desktop etc.
Maybe this is a misunderstanding but I want “Docker” as an Application/Program, not as a OS to boot into? is that an option? Cause I already used Etcher for ANOTHER 8GB SD Card that I flashed on my windows PC. The SD card shows up as SDA1. And currently it has the hypriotOS name on it.
So can I plug the 8GB SD card into the RPi3 using the 32GB microSD as its boot OS drive and load it that way?
I ave already done all the apt-get updates, etc and the FW update etc, so all that is done.
Please advise, about the next steps with this SD card process or maybe what I am missing.



Great, thanks for the info! Much clearer exactly where you need help now.

From the brewpi page in portainer there should be a >_ Console button.


Click it. Then click the “Connect” button on the next page. You now have terminal open that’s currently in the home folder where all the brewpi files live. You can type ls to list the files and folders (folders are those without extensions).

root@c58bfe7a3eaf:/home/brewpi# ls
BEERSOCKET         BrewPiUtil.pyc       autoSerial.pyc     expandLogMessage.pyc    tests   LogMessages.h   brewpiVersion.pyc    logs                  programController.pyc   utils
BrewPiProcess.pyc   backgroundserial.pyc  brewpi_dontrun          settings    MigrateSettings.pyc        parseEnum.pyc         start.bat
BrewPiSocket.pyc           data                 brewpiJson.pyc  pinList.pyc           temperatureProfile.pycs

You’ll see the settings folder is here. You can change to it with cd settings and list the contents again with ls.

root@c58bfe7a3eaf:/home/brewpi# cd settings
root@c58bfe7a3eaf:/home/brewpi/settings# ls
config.cfg  config.cfg.example  defaults.cfg  tempProfile.csv

You want to edit config.cfg. For reasons that aren’t apparent to me, before doing so, you need to type export TERM=xterm (to get access to some standard terminal commands–including a text editor).

root@c58bfe7a3eaf:/home/brewpi/settings# export TERM=xterm
root@c58bfe7a3eaf:/home/brewpi/settings# nano config.cfg

Then, using nano (a simple text editor) you can edit the “port” line as described in the wiki. Press ctrl-O and then Enter to save, then ctrl-X to exit. The brewpi web interface should now should the script running (which means the pi can connect to the spark.

You could also find this file directly on the pi and edit it through ssh or by hooking up a keyboard and monitor directly to the pi, but in my mind at least the portainer route is more convenient even if it requires the weird TERM=xterm workaround.

Hope this helps!


Ok so @adempewolff & @Elco I think I am stuck with step 6 of this. I have my Portainer Page up, and I also downloaded the iOS “Particle” App. I have the Pi and the Spark connected via USB and I already used the CMD to add the --device part. at the end but I have this error:
and the Particle App process does not show any Wifi networks.
I would like the option to connect to the spark either wifi or USB. In either case I still can NOT access the Brewpi webpage using the port/socket of 6666
SO right now I have:
scriptPath = /home/brewpi
wwwPath = /var/www/html
port = auto
port = socket://
altport = /dev/ttyACM0
boardType = p1
beerName = My First BrewPi Run
interval = 60.0
dataLogging = active
pi@raspberrypi:~/brewpi-data/settings $
But when I put in that IP nothing happens.

The logs from the Portainer show:
/ 40: exec: --device=/dev/ttyACM0:/dev/ttyACM0: not found

I hope this is helpful - please advise :slight_smile:

FYI I followed the directions (to get it to work) from these places:

and the latter part of this:
And now I was trying to use this part:


I’m not sure if you can currently configure brewpi to use both Wifi and USB at the same time but Elco can correct me if I’m wrong. My understanding is that you either need to use USB and add the --device=/dev/ttyACM0:/dev/ttyACM0 parameter when you deploy the brewpi docker container or use WIFI and change port = auto to port = socket:// in the /home/brewpi/settings/config.cfg file. I don’t think you can define two ports in the config file as you have done.

For the USB configuration, the docker deploy command will then be docker run -d --name brewpi -p 80:80 -v ~/brewpi-data:/data -v /etc/timezone:/etc/timezone -v /etc/localtime:/etc/localtime --restart always --device=/dev/ttyACM0:/dev/ttyACM0 brewpi/brewpi-raspbian. Critically, this command needs to be run on the pi itself (ie. by sshing into the Hypriot or Rasbian OS), not by using portrainer to open a command prompt within the brewpi container. I think you are trying to run this command from within a brewpi container that has already been deployed.


Correct, you should use either

port = auto

for USB or

port = socket://<your-spark-ip>:6666

for WiFi.

You cannot have multiple port definitions.

I am working on updating the brewpi docker image to the latest version now, so I recommend waiting a day until it is updated.


I’ve been using the BREWPI SPARK V2 on a Raspi 2 for the past few years. I’ve been wanting to convert to Docker. I’ve setup other containers for various other projects but I’m having trouble with this.

I’ve got the Sparkv2 hooked up to a converter to go from USB to Ethernet, is this Ok?
This is what my script is to build the container: sudo docker run -d --name brewpi -p 83:80 -v /volume1/docker/brewpi:/data --restart always --device=/dev/ttyACM0:/dev/ttyACM0 brewpi/brewpi-ubuntu. It will run and I see the test page but I don’t see any files in the /docker/brewpi folder for any additional configurations. Is this the best place to look?



I successfully set up Brewpi in Docker on my Synology NAS. I set up port forwarding, so that the Brewpi webpage is accessible through a personal URL. I can see the unsecured webpage from anywhere, but so can anyone else. There is a secured webpage which I also port forwarded, but when I try to see that page, it asks for a user and password. I tried every likely possible pairing I could think of, and looked at the documentation for a default user and pass, but couldn’t find one. I would like to shut down the unsecured webpage, and only have the secured one be available on the web, but I need the user and password for it to be useful. Any advice on what the user and pass might be?



Sorry, I haven’t updated the docs for the password protected port. This is new in the latest version of the container. Nice that you have spotted it.

The latest version of the container exposes two ports:
port 80 for use on your internal network, without password.
port 81 for forwarding on your router, with password.

The default user is brewer and password brewpi.
You can change that by running this command in the container (replace brewer and brewpi with your desired user/pass):

htpasswd -bc /data/settings/brewpi.htpasswd brewer brewpi