scripts/config.cloudflare.homelab.md
2025-05-05 11:58:47 -06:00

78 lines
2.2 KiB
Markdown

---
author: The Bunker Admin
date: 2025 05 02
tags: [sript]
---
## config.cloudflare.homelab
This config will show you how to set up a single dedicated Cloudflare for your Ubuntu machine.
See [[scripts/build.homelab|build.homelab]] for installation instructions
See [[service.cloudflared]] for starting as system service
---
### Create Tunnel
Create your named tunnel:
**Remember to replace tunnel name**
```
cloudflared tunnel create [tunnel-name]
```
This will output something like the following:
`Tunnel credentials written to /home/bunker-admin/.cloudflared/bb8951df-9d45-4a3b-a283-15a5ef7e7620.json. cloudflared chose this file based on where your origin certificate was found. Keep this file secret. To revoke these credentials, delete the tunnel.`
`Created tunnel config-bnkhome with id bb8951df-9d45-4a3b-a283-15a5ef7e7620`
You want to keep this information and note the id.
### Create Config File
```
nano ~/.cloudflared/config-[tunnel-name].yml
```
### Add Your Config
**Remember to replace the two tunnel id numbers with your tunnel id number**
```
tunnel: [insert tunnel id number]
credentials-file: /home/bunker-admin/.cloudflared/[insert tunnel id number].json
ingress:
- hostname: qbittorrent.bnkhome.org
service: http://localhost:8082
- hostname: flaresolverr.bnkhome.org
service: http://localhost:8191
- hostname: prowlarr.bnkhome.org
service: http://localhost:9696
- hostname: radarr.bnkhome.org
service: http://localhost:7878
- hostname: overseerr.bnkhome.org
service: http://localhost:5055
- hostname: sonarr.bnkhome.org
service: http://localhost:8989
- hostname: homepage.bnkhome.org
service: http://localhost:3000
- hostname: tautulli.bnkhome.org
service: http://localhost:8181
- hostname: whisparr.bnkhome.org
service: http://localhost:6969
- hostname: glances.bnkhome.org
service: http://localhost:61208
- hostname: daisy.bnkhome.org
service: http://localhost:8080
- hostname: gitea.bnkhome.org
service: http://localhost:3001
- hostname: bazarr.bnkhome.org
service: http://localhost:6767
- service: http_status:404
```
### Test Tunnel
**Remember to update the tunnel-name**
```
cloudflared tunnel --config ~/.cloudflared/confi-[tunnel-name].yml run
```