# Expose your service/homelab/On-premise Hosting using boringproxy

**URL:** <https://forum.hhf.technology/t/expose-your-service-homelab-on-premise-hosting-using-boringproxy/228>\
**Category:** Home Networking\
**Tags:** boringproxy, tunnels\
**Created:** [October 17, 2024, 6:25am UTC](https://forum.hhf.technology/t/expose-your-service-homelab-on-premise-hosting-using-boringproxy/228 "2024-10-17T06:25:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hhf.technoloy](https://forum.hhf.technology/user_avatar/forum.hhf.technology/hhf.technoloy/32/68_2.png) [@hhf.technoloy](https://forum.hhf.technology/u/hhf.technoloy)\
**Post date:** [October 17, 2024, 6:25am UTC](https://forum.hhf.technology/t/expose-your-service-homelab-on-premise-hosting-using-boringproxy/228/1 "2024-10-17T06:25:31Z")

</div>

# Expose your service to the world using boringproxy

## What is boringproxy?

Boringproxy is a reverse proxy that allows you to expose your local development environment to the internet. It’s free for personal use and it’s easy to use.

## How to use it?

### Prerequisites

- Server with public IP address
- Domain name
- Local apps that you want to expose to the world

### Installation

```sh
# Install boringproxy
curl -LO https://github.com/boringproxy/boringproxy/releases/latest/download/boringproxy-linux-x86_64

# Make it executable
chmod +x boringproxy-linux-x86_64

# Move it to /usr/local/bin
sudo mv boringproxy-linux-x86_64 /usr/local/bin/boringproxy

# Allow binding to ports 80 and 443
sudo setcap cap_net_bind_service=+ep /usr/local/bin/boringproxy

```

### Setup Domain

**On your domain registrar, add the following A records:**

- `@` pointing to your server’s public IP address
- `*` pointing to your server’s public IP address

### Run boringproxy in the background using tmux

```sh
tmux new -s boringproxy

```

**On tmux, run the following command:**

```sh
boringproxy server -admin-domain <your-domain> -acme-email <your-email> -accept-ca-terms

```

### Setup your local machine side

**Install boring proxy like above**

**On your local machine, run the following command:**

```sh
boringproxy client \
-server <your-domain> -token <your-token> \
-user <default is "admin"> -acme-email <your-email> \
-client-name <your-client-name>

```

### Access boringproxy dashboard

**On your boringproxy server side, run the following command:**

```sh
cat ~/boringproxy_db.json

```

Output should be like this:

```
    {                                                           
    "admin_domain": "<your-domain>",                       
    "tokens": {                                       
        "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx": {   
        "owner": "admin"                        
        }
    ...

```

**Access your boringproxy dashboard using this URL: `https://<your-domain>` and paste the token on the login page.**

### Test exposing your service

**On your local machine, run the following command:**

```sh
# install nginx
sudo apt-get install nginx

# start nginx
sudo systemctl start nginx

```

**On your boringproxy dashboard, add tunnel and set like this:**

- Domain: `<your-choose-domain>`
- Tunnel Port: Random
- Client Name: `<choose-your-client-name>`
- Client Address: `127.0.0.1`
- Client Port: `80`
- TLS Termination: `<client-https>`
- and submit

 ![image](https://forum-cdn.hhf.technology/original/1X/fdc350d802049896af80d7db98df60d96eeceda8.png)

**On your browser, access your service using this URL: `https://<your-choose-domain>` and walla, your service has been exposed to the world**

 ![image](https://forum-cdn.hhf.technology/original/1X/ed7ac7ea1302b5649e5e3e584fb97f3043880426.png)

### References

- [Boringproxy](https://boringproxy.io/)
