Web Environment

Port forwarding

When developing web apps, testing across multiple devices is vital to ensure that what you’re building will work for you users. Chrome OS’s built-in port forwarding allows you to open the port to your local development server, allowing access from phones or other computers.

Start by going to the Linux (Beta) settings on Chrome OS and clicking the Linux box. There should be an option Port forwarding. Click on that.

Linux settings page.

This will open up the Port forwarding screen. When you set up ports to be forwarded, they’ll show up here. Click the Add button to forward a port.

Empty port forwarding settings page.

When forwarding a port, you have three options: the port number to forward, the connection type, either TCP(default) or UDP, and if you want to label the port.

Configuring port forwarding to forward port 3000 using TCP with a label "Server".

Once added, your ports will show up in the Port forwarding list, where you can toggle them on or off or remove them entirely.

Port forwarding settings page with a configured port of 3000 using TCP labeled "Server".

In order to get the IP address to use with that port, in your Terminal app, run hostname -I. This IP address, combined with the port you’re forwarding, will allow any device on the network access to the server on the port you’ve forwarded.