Setting up OctoPrint on a Raspberry Pi running Raspbian

I seem to have the same problem. I see you found a solution online, but any reasons as to why it works?

UPDATE: I think I figured out the issue (I'm assuming @Bence_Voros was also setting up octo on a non raspberry pi computer). If you're not using a pi you need to change the username pi to whatever your username is in the /etc/default/octoprint (there should be two places you need to change it)

The nginx webcam location configuration requires proxy_buffering set to off, otherwise it will load forever.

        location /webcam/ {
                proxy_buffering off;
1 Like

The steps worked flawlessly setting up a Pi 4 (1GB). I replaced my Zero W which worked despite discouragement everywhere and... wow, the Pi 4 is so much faster.
I used the backup/restore plugin which also worked great.
Many thanks for such great software!


Thanks for posting this guide.... I know just enough to be dangerous and a little surprised I got it all to work.... Thanks again

1 Like

Note that if you're using another shell (I'm using fish), this line will not work - you'll need to switch to bash or source a different file. Luckily, an is also included, so I could just source that instead.

This install guide worked well on a Pine 64 and the Armbian Buster server image.



I installed this on a RPi4 with no issues starting from "2019-07-10-raspbian-buster-full.img" as I have an 7" LCD attached. My question is I installed TouchUI and boot directly into the epiphany browser as per the instruction but when I exit the browser I just get a black screen. Is there anyway to get it to go back to the default GUI?

It may be necessary to change what the display sees:

Ctrl-Shift-F1 through F7 or F8 to the best of my knowledge will select the different ones. The X11 screens start at F7 and all before that are tty.

1 Like

Just ran through these steps on a shiny new Raspberry Pi 4 (4Gb) and everything seems to be up and running. I think the only trouble I had was when I accidentally skipped over steps, or things didn't save correctly because I didn't sudo first.

Hello. Completely new to the Raspberry Pi platform, but have been doing Arduino for years. I want to run OctoPrint on a 3B+ running regular Raspian so I can also run Pi-Hole and who knows what else simultaneously. I print a lot and have no qualms about leaving it on. Of course, I do want the webcam to keep an eye on things remotely. Would this guide be appropriate for me?

Note that PiHole is known to block the software update process within OctoPrint. Personally, I wouldn't put non-related things also on this Pi since the quality of print jobs is what you're after, IMHO.

For me, I'd rather just buy more Pi computers and dedicate those to these other tasks.


Excellent guide. Just the right balance between too brief and too detailed!


To make the webcam work I had to add the script (with file name 'webcam') in directory /etc/init.d and not home/pi/scripts/webcam. Next, I did follow what was required for the webcamDaemon file (Make sure you create the file 'scripts'). Finally I executed the following two commands to make it work.

sudo chmod 755 /etc/init.d/webcam
sudo update-rc.d webcam defaults

Another note is you won't have to add the "/home/pi/scripts/webcam start" in the rc.local file.

Phenomenal post. Made an account just to <3 this!

1 Like

<If you want to be able to start and stop mjpeg-streamer from within OctoPrint, put the following in /home/pi/scripts/webcam :

# Start / stop streamer daemon

case "$1" in

  • start)*
  •    /home/pi/scripts/webcamDaemon >/dev/null 2>&1 &*
  •    echo "$0: started"*
  •    ;;*
  • stop)*
  •    pkill -x webcamDaemon*
  •    pkill -x mjpg_streamer*
  •    echo "$0: stopped"*
  •    ;;*
  • )
  •    echo "Usage: $0 {start|stop}" >&2*
  •    ;;*


Put this in /home/pi/scripts/webcamDaemon :>

i Just want it to start when i startup the pi but it doesn't do shit

I guess you missed that part :wink:

@foosel thanks for a great tutorial. Please consider adding another Heads-up section somewhere next to camera optional section saying:
Don't forget to enable connection to the Raspberry Pi Camera in RPI config:

- sudo raspi-config
- choose '5 Interfacing Options/P1 Camera -> Enable'
- reboot

I configured lots of OctoPrints, but last time I spent quite some time looking for a reason why the camera didn't want to work :slight_smile:


You may want to consider adding the following optionals to your guide:

1.Reduce priority of TouchUI/Webkit for the printer display: add

renice -n 19 -p $(pgrep WebKit)

to the end of - once I did this my camera framerate became MUCH smoother
2. Set a static focal point for your webcam, if it can focus (like the C920):

v4l2-ctl --set-ctrl=focus_auto=0
v4l2-ctl --set-ctrl=focus_absolute=40 # your number here
1 Like

Honestly, the author of that plugin needs to own that suggestion, in my humble opinion. Why not create an issue on their repository and let them know what you experienced and suggest the workaround?

I don’t think it’s an issue with the plugin. It’s an issue with WebKit.