> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ahmadraza.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloudflared

### **Cloudflared Commands and Configuration**

#### **Configuration File Location**

* **Linux**: `/etc/cloudflared`
* **Credentials File**: `/root/.cloudflared/<TunnelUUID>.json`

#### **Configuration File (`config.yml`)**

Example configuration for the file located at `~/.cloudflared/config.yml`:

```yaml theme={null}
tunnel: <TunnelUUID>
credentials-file: /root/.cloudflared/<TunnelUUID>.json

ingress:
  - hostname: myhome.smartghar.org
    service: http://192.168.0.1
  - service: http_status:404
```

#### **Commands**

1. **Update Cloudflared**:
   ```sh theme={null}
   cloudflared update
   ```

2. **Login to Cloudflare**:
   ```sh theme={null}
   cloudflared login
   ```

3. **Create a New Tunnel**:
   ```sh theme={null}
   cloudflared tunnel create <YourTunnelName>
   ```

4. **Edit Configuration**:
   ```sh theme={null}
   sudo nano ~/.cloudflared/config.yml
   ```

5. **Route DNS to Tunnel**:
   ```sh theme={null}
   cloudflared tunnel route dns <TunnelName> <hostname>
   ```

6. **Run the Tunnel**:
   ```sh theme={null}
   cloudflared tunnel run <TunnelName>
   ```

#### **Revision History**

* **Revision #4**
* **Created**: 17 November 2023 12:40:11 by Admin
* **Updated**: 9 December 2023 21:42:53 by Admin

***

Feel free to adjust the `<TunnelUUID>`, `<YourTunnelName>`, and `<hostname>` with your actual values. If you have any specific questions or need further details, let me know!
