DEV Community

Mehdi mFat
Mehdi mFat

Posted on

2

How to access a local service over the internet using bore

Bore is a modern, simple TCP tunnel written in Rust that exposes local ports to a remote server, bypassing standard NAT connection firewalls.

The advantage of Bore over some popular services such as ngrok is that it can be hosted on your own server. The CLI is also very straightforward and intuitive.

Installing Bore is very easy:

cargo install bore-cli

# On your local machine
bore local 8000 --to bore.pub
Enter fullscreen mode Exit fullscreen mode

This command gives you a public URL that points to your local port 8000. No need for opening ports on your router or using dynamic DNS!

Instead of using bore servers you can use your own VPS to route traffic to your home.

Self-hosting bore is as simple as installing it on your server and running:

bore server
Enter fullscreen mode Exit fullscreen mode

Now if my server's ip address is 2.2.2.2 this is what I need to run on my home computer to access a service running on port 9981 of my home PC through my VPS:

bore local 9981 --to 2.2.2.2
Enter fullscreen mode Exit fullscreen mode

Bore server assigns a random port to this tunnel. Now I can access my local service running on port 9981 of my home PC using 2.2.2.2:PORT

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay