The “Invisible Tunnel”: Host from Your Laptop via Oracle Cloud and Tailscale

Have you ever wanted to turn your local machine into server for your cools Projects.

In this guide, I’ll show you how to use an Oracle Cloud Free Tier instance as a “Public Gateway” to your laptop using Tailscale. No public ports open on your home router, no complex VPN configs—just a secure, encrypted tunnel.

The Architecture
We are creating a bridge.

The Laptop: Runs your app (e.g., port 3000).

Tailscale: Connects your laptop and VPS into a private “Tailnet.”

Oracle VPS: Acts as a Reverse Proxy using Nginx to take public traffic (Port 80/443) and send it down the tunnel.

  • 1. The Tailscale Magic
    First, install Tailscale on both your laptop and your Oracle VPS.
curl -fsSL https://tailscale.com/install.sh | sh
sudo tailscale up

Once both are authenticated, they will have private IPs (like 100.x.y.z). These IPs can “see” each other globally as if they were on the same Wi-Fi.

  • 2. Enable “Exit Node” (The Tunneling Part)
    If your goal is to use the VPS as a tunnel for your other devices (so your home PC appears to have the VPS’s IP address), you must advertise it as an exit node in your VPS:
sudo tailscale up --advertise-exit-node
  • 3. Approve the Exit Node (Admin Console)

For security, Tailscale doesn’t allow a device to become an exit node automatically.

  • Open your Tailscale Admin Console.
  • Find your VPS in the Machines list.
  • Click the three dots (…) > Edit route settings.
  • Check the box for Use as exit node and click Save.

    • 4. How to use it on your other PC

Now that the VPS is ready, you can “tunnel” through it from your laptop or mobile:

  • On Windows/Mac: Click the Tailscale icon in the system tray > Exit Node > Select your VPS.
  • On Linux: Run tailscale up --exit-node=<vps-tailscale-ip>.
  • On Android/iOS: Open the app > Tap the “Exit Node” entry > Select your VPS.

Now You can run any server on any port in your local laptop
and you can access from VPS by

curl -I http://<laptop-tailscale-ip>:3000

It will show your laptop server details
means you have enable connection between VPS and local laptop

  • 5. Now you have to redirect your VPS public ip to laptop tunnel using ngnix (so anyone to your VPS public ip it will show your local server response )

Install Nginx on the VPS:

sudo apt install nginx
  • 6. Configure Nginx on the VPS
    On your VPS, create a new configuration file for your proxy:
sudo nano /etc/nginx/sites-available/tailscale-proxy

Configure Nginx to Forward Traffic:
Edit your Nginx config to “proxy” requests from the VPS public IP to your Home PC’s Tailscale IP.

Nginx

Paste the following configuration into the file:

Nginx
server {
    listen 80;
    server_name _; # e.g., 1.2.3.4 or example.com _means all

    location / {
        # Redirect traffic to your Home PC's Tailscale IP
        proxy_pass http://100.10.20.30:3000; 

        # Standard proxy headers to pass user info to your app
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # Optional: Handle WebSockets (useful for React/Next.js dev servers)
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
  • 7. Enable the Configuration
    Link the file to the sites-enabled directory and test the Nginx syntax:

Bash

Enable the site

sudo ln -s /etc/nginx/sites-available/tailscale-proxy /etc/nginx/sites-enabled/

Test for syntax errors

sudo nginx -t

If it says “test is successful”, restart Nginx

sudo systemctl restart nginx

Result: When someone visits your VPS’s public IP, the VPS sends that traffic through the encrypted Tailscale tunnel to your local PC.

You can test by going to your VPS public IPS

Use https://canyouseeme.org/ if you face issue to debug

Leave a Reply