How to Configure Port Forwarding in Linux on Chromebook to Access Local Dev Servers

Chromebooks running the Linux development environment (Crostini) have emerged as capable workstations for web development, Python programming, and Docker containerization. When you launch a development server—such as a Node.js Express API, Next.js web app, or Python Flask service—on port 3000 or 8080 inside your Linux container, Chrome OS automatically routes traffic from http://localhost:3000 in your Chromebook browser. However, because Crostini operates inside a sandboxed virtual machine with its own internal virtual network bridge, testing your web applications on mobile phones, tablets, or other computers on your local Wi-Fi network requires configuring Port Forwarding.

How Networking Operates in Chrome OS Crostini

Understanding the internal network topology clarifies why port forwarding is necessary:

  • Virtual Machine Isolation: The Linux container resides inside a Termina virtual machine with a private subnet IP address (typically 100.115.92.x) inaccessible directly from your home or office local area network (LAN).
  • Host Loopback Proxy: Chrome OS automatically proxies local traffic from the Chrome browser to the Linux VM, enabling localhost access exclusively on the Chromebook itself.
  • LAN Ingress Restriction: By default, incoming connections from external Wi-Fi clients (such as your iPhone or another PC pointing to your Chromebook’s LAN IP address 192.168.1.x) are blocked by the Chrome OS host firewall.

Step 1: Discover Your Chromebook’s Local IP Address

Before configuring port forwarding, identify your Chromebook’s IP address on the local Wi-Fi network:

  1. Click the Quick Settings panel in the bottom-right corner of your Chrome OS shelf (the clock/battery area).
  2. Click your active Wi-Fi network connection.
  3. Click the connected Wi-Fi SSID name to open its network details.
  4. Expand the Network section.
  5. Note the IP address listed (for example, 192.168.1.145). This is the address other devices on your LAN will target.

Step 2: Start Your Linux Web Server on All Network Interfaces

Development servers often bind by default exclusively to loopback (127.0.0.1). For a server to accept traffic forwarded from the virtual machine gateway, it must bind to all network interfaces (0.0.0.0):

Example: Node.js / Vite Server

# Start Vite with host binding
npx vite --host 0.0.0.0 --port 5173

Example: Python Flask Server

# Start Flask binding to all interfaces
flask run --host=0.0.0.0 --port=5000

Example: Simple Python HTTP Test Server

# Serve current directory on port 8080
python3 -m http.server 8080 --bind 0.0.0.0

Step 3: Configure Port Forwarding Rules in Chrome OS Settings

Chrome OS provides a dedicated management panel to route inbound network ports through the host firewall into the Linux container:

  1. Open Settings on your Chromebook.
  2. In the left sidebar, click About ChromeOS, or navigate directly to Developers.
  3. Click Linux development environment.
  4. Under the Linux settings menu, select Port forwarding.
  5. Click the Add port button in the upper-right corner.
  6. In the configuration dialogue:
    • Port number: Enter the target port number (e.g. 5173, 5000, or 8080).
    • Protocol: Select TCP (or UDP if testing game servers or streaming).
    • Label: Enter a recognizable description, such as Vite Dev Server or Flask Backend.
  7. Click Add to save the rule.

Step 4: Enable the Forwarding Rule and Test Connectivity

Once created, rules remain listed in the Port Forwarding table:

  1. Ensure the toggle switch beside your newly created port rule is set to On.
  2. Open a browser on another device (such as an iPhone, Android tablet, or desktop PC) connected to the same Wi-Fi network.
  3. In the address bar, type your Chromebook’s LAN IP address followed by the port:
    http://192.168.1.145:8080
  4. The web application hosted inside your Chromebook’s Linux container will load immediately on the secondary device.

Step 5: Manage and Delete Unused Forwarding Rules

To preserve security and battery life when working on public Wi-Fi networks:

  • Temporary Deactivation: Toggle individual rules to Off in the Port Forwarding menu when not actively conducting multi-device testing.
  • Permanent Removal: Click the three-dot action icon next to an obsolete rule and select Delete.

Troubleshooting Port Forwarding on Chromebooks

If external devices cannot establish a connection, ensure that your Wi-Fi router does not enforce Client Isolation (AP Isolation), which prevents wireless devices from communicating with one another. Furthermore, confirm inside the Linux terminal that your service is actively listening on all interfaces by running ss -tulpn | grep <port> and verifying that the local address displays 0.0.0.0:<port> rather than 127.0.0.1:<port>.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.