How to Install Selenoid on NixOS Latest
In this tutorial, we will walk you through the steps required to install Selenoid on the latest version of NixOS. Selenoid is a powerful and lightweight alternative to Selenium for running Selenium tests. It provides better performance, stability, and more features than Selenium.
Prerequisites
Before you begin, make sure you have the following:
- A user account with sudo privileges
- The latest version of NixOS installed on your system
Step 1: Install Docker
Selenoid requires Docker to run, so the first step is to install Docker on your system. Run the following command to install Docker:
sudo nix-env -iA nixos.docker
Once installed, start Docker by running:
sudo systemctl start docker
And enable it at boot using:
sudo systemctl enable docker
Step 2: Install Selenoid
We will be installing Selenoid using the nix-env package manager. Run the following command to install Selenoid:
sudo nix-env -iA selenoid
This will install Selenoid and all of its dependencies.
Step 3: Configure Selenoid
To configure Selenoid, create a configuration file at /etc/selenoid/browsers.json with the following content:
{
"chrome": {
"default": "90.0",
"versions": {
"90.0": {
"image": "selenoid/chrome:90.0",
"port": "4444",
"tmpfs": {"/tmp": "size=128m"}
}
}
}
}
This configuration will set up the Chrome browser to run on port 4444.
Step 4: Start Selenoid
To start Selenoid, run the following command:
sudo systemctl start selenoid
You can now test Selenoid by accessing http://localhost:4444/status in your browser.
Conclusion
In this tutorial, you learned how to install Selenoid on the latest version of NixOS. Selenoid is a powerful and lightweight alternative to Selenium that provides better performance, stability, and more features. If you encounter any issues during the installation process, consult the official Selenoid documentation for further assistance.