How to Install Selenoid on Ubuntu Server Latest
Selenoid is a cross-platform implementation of Selenium WebDriver API which allows running web browser tests in Docker containers. In this tutorial, we will provide step-by-step instructions for installing Selenoid on Ubuntu Server using Docker.
Prerequisites
- Ubuntu Server Latest version (with sudo access)
- Docker installed on your Ubuntu Server
- Docker Compose installed on your Ubuntu Server
Step 1: Install Selenoid
- Create a
docker-compose.ymlfile in the root folder of your Ubuntu Server with the following content:
version: '3'
services:
selenoid:
image: aerokube/selenoid:latest-release
container_name: selenoid
hostname: selenoid
stop_grace_period: 5s
network_mode: bridge
ports:
- "4444:4444"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "$PWD:/etc/selenoid"
command: ["-conf", "/etc/selenoid/browsers.json", "-disable-docker"]
- Create a
browsers.jsonconfiguration file in the root folder of the Ubuntu Server. Paste the following content to configure the web browsers you want to use:
{
"firefox": {
"default": "latest",
"versions": {
"latest": {
"image": "selenoid/firefox:latest"
}
}
},
"chrome": {
"default": "latest",
"versions": {
"latest": {
"image": "selenoid/chrome:latest"
}
}
}
}
This configuration sets up the latest versions of Firefox and Chrome for testing.
- Start the Selenoid service by running the following command:
sudo docker-compose up -d
This command will download and install the Selenoid Docker image and start the Selenoid service on your Ubuntu Server.
Step 2: Verify Selenoid Installation
Run the following command to list all running Docker containers on your Ubuntu Server:
sudo docker ps
You should see selenoid listed as a running container.
You can also verify that Selenoid is working properly by opening the following URL in your web browser:
http://[Ubuntu_Server_IP]:8080/status
If everything is working properly, you should see a status page containing information about the available web browsers and the number of running browser instances.
Conclusion
Congratulations! You have successfully installed Selenoid on your Ubuntu Server. You can now use Selenoid to run Selenium WebDriver API tests in Docker containers.