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

Step 1: Install Selenoid

  1. Create a docker-compose.yml file 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"]
  1. Create a browsers.json configuration 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.

  1. 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.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!