Skip to content

Instantly share code, notes, and snippets.

Last active Dec 4, 2020
What would you like to do?
Setup OBS Studio on Ubuntu
# Download and run the script (tested on Ubuntu 20):
# curl -s | sh
# Read notes about the script:
# Once installed, you can access OBS using vnc client on port 6701.
echo "installing OBS for ubuntu.."
apt update -y &&
apt install libxkbcommon0 libxrandr2 libqt5core5a -y &&
apt-get install software-properties-common -y &&
add-apt-repository ppa:obsproject/obs-studio -y &&
apt update -y &&
apt install screen sed -y &&
apt install obs-studio -y &&
apt install ffmpeg vlc -y &&
apt install tasksel -y &&
tasksel install ubuntu-desktop &&
wget -O virtualgl_2.6.3_amd64.deb &&
dpkg -i virtualgl_*.deb &&
/opt/VirtualGL/bin/vglserver_config -config -s -f -t &&
wget -O turbovnc_2.2.5_amd64.deb &&
dpkg -i turbovnc_*.deb &&
sed -i 's/$vncPort = 5900 + $displayNumber;/$vncPort = 5900 + $displayNumber;\nif(defined $ENV{'BASE_PORT'}) {\n $vncPort = $ENV{'BASE_PORT'} + $displayNumber;\n}/' /opt/TurboVNC/bin/vncserver &&
BASE_PORT=6700 /opt/TurboVNC/bin/vncserver &&
/usr/bin/screen -dmS obs /usr/bin/sh -c "DISPLAY=:1 /usr/bin/obs --studio-mode" &&
echo '@reboot BASE_PORT=6700 /opt/TurboVNC/bin/vncserver' >/tmp/crontab-obs &&
echo '@reboot /usr/bin/screen -dmS obs /usr/bin/sh -c "DISPLAY=:1 /usr/bin/obs --studio-mode"' >>/tmp/crontab-obs &&
(crontab -l ; cat /tmp/crontab-obs )| crontab -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment