Skip to content

Instantly share code, notes, and snippets.

@iamumairayub
Created December 26, 2023 06:57
Show Gist options
  • Save iamumairayub/1e0340779338f5463e3d49ade325cf47 to your computer and use it in GitHub Desktop.
Save iamumairayub/1e0340779338f5463e3d49ade325cf47 to your computer and use it in GitHub Desktop.
Setup Selenoid and Selenoid UI with auth protected on Ubuntu.
timedatectl set-timezone America/Toronto
mkdir /home/selenoid
cd /home/selenoid
apt update -y
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
rm -rf cm_linux_amd64
wget https://github.com/aerokube/cm/releases/download/1.8.5/cm_linux_amd64
chmod +x cm_linux_amd64
echo '
{
"chrome": {
"default": "119.0",
"versions": {
"119.0": {
"image": "selenoid/chrome:119.0",
"port": "4444",
"path": "/"
}
}
}
}
' > /home/selenoid/browsers.json
./cm_linux_amd64 selenoid cleanup
./cm_linux_amd64 selenoid stop && ./cm_linux_amd64 selenoid start --vnc --args '-limit 30 -session-attempt-timeout 180s -service-startup-timeout 3m' --browsers-json browsers.json
rm -f selenoid-ui_linux_amd64
wget https://github.com/aerokube/selenoid-ui/releases/download/1.10.3/selenoid-ui_linux_amd64
sudo apt-get install -y apache2-utils
htpasswd -bc /home/selenoid/selenoid.htpasswd myselenoid vVhc4SUUdx2jv5tz
echo "
[Unit]
Description=Selenoid UI service
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/home/selenoid/
ExecStart=/home/selenoid/selenoid-ui_linux_amd64 -users /home/selenoid/selenoid.htpasswd
[Install]
WantedBy=multi-user.target
" >> /lib/systemd/system/selenoid-ui.service
chmod +x selenoid-ui_linux_amd64
systemctl enable selenoid-ui.service
systemctl start selenoid-ui.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment