</>

Technology

Selenium

Difficulty

Beginner

Interview Question

What is the default port for Selenium Grid?

Answer

Default Port for Selenium Grid

The default port for Selenium Grid Hub is 4444.

Access the Grid Hub at:

CODE
http://localhost:4444/grid/console     (Selenium 3)
http://localhost:4444                  (Selenium 4)
http://localhost:4444/status           (Selenium 4 health check)

Starting Selenium Grid Hub (Selenium 3):

Bash
# Start the hub on default port 4444
java -jar selenium-server-standalone-3.141.59.jar -role hub

# Start hub on custom port
java -jar selenium-server-standalone-3.141.59.jar -role hub -port 5555

Registering a Node to the Hub:

Bash
# Register node to hub on port 4444
java -jar selenium-server-standalone-3.141.59.jar \
  -role node \
  -hub http://localhost:4444/grid/register

Selenium 4 Grid (new unified approach):

Bash
# Start Selenium 4 Grid (hub + node in one)
java -jar selenium-server-4.x.x.jar standalone

# Or separate hub and node
java -jar selenium-server-4.x.x.jar hub      # Port 4444
java -jar selenium-server-4.x.x.jar node     # Port 5555 (node default)

RemoteWebDriver connecting to Grid:

Java
// Connect test to Selenium Grid hub
DesiredCapabilities caps = new DesiredCapabilities();
caps.setBrowserName("chrome");

WebDriver driver = new RemoteWebDriver(
    new URL("http://localhost:4444/wd/hub"),
    caps
);
driver.get("https://example.com");

Port summary:

ComponentDefault Port
Selenium Grid Hub4444
Selenium Node5555 (configurable)
Grid Console UI4444/grid/console

Key point: Port 4444 is the default. Always verify the hub is running at this port before connecting nodes or test scripts.

Follow AutomateQA

Related Topics